While studying for the Chern-Weil description of the characteristic classes, we consider the procedure to cook up invariant polynomials under the adjoint action.
That is, given a principal $G$-bundle $P \to M$, we consider symmetric multilinear maps $f: (\Omega^{\mathrm{even}}(M) \otimes \mathfrak{g})^k \to \mathbb{C}$ that are invariant under the ($k$-fold induced action) of the adjoint action $G \to \mathrm{GL} (\mathfrak{g})$.
For the Chern classes, we consider $G = \mathrm{U}(n)$ and the skew-hermitian matrices $\mathfrak{g} = \mathfrak{u}(n)$. What is nice is that every element in $\mathfrak{u}(n)$ is conjugate to an element in the Cartan subalgebra $\mathbb{C}^n$ (diagonal skew-hermitian matrices) of $\mathfrak{u}(n)$, and the conjugacy classes in the Cartan subalgebra correspond to the orbits of the Weyl group $W_{\mathrm{U}(n)} = S_n$. So we can identify the adjoint invariant polynomials on $\mathfrak{g}$ as the symmetric polynomials on $n$ variables.
My question is when does this behavior (that is, every element of $\mathfrak{g}$ can be taken into the Cartan subalgebra by the adjoint action, and the orbit of the restricted action on the Cartan subalgebra is equal to the orbit of the Weyl group) occur? I see this for $G = \mathrm{U}(n)$ or $G = \mathrm{O}(n)$, but I am not sure if the definition of the Cartan subalgebra yields this result. Does it work for matrix Lie groups in general? I am a bit rusty on Lie theory, but any help is appreciated!
Let $\mathfrak{g}$ be a real semisimple* Lie algebra and $\mathfrak{h}$ a Cartan subalgebra (equivalently, a maximal subalgebra among the ones which are abelian and consist of semisimple elements). A necessary and sufficient criterion for every element $x\in \mathfrak{g}$ to be conjugate to an element in $\mathfrak{h}$ is that $\mathfrak{g}$ is compact.
For, if $\mathfrak{g}$ is not compact, it contains nilpotent elements $\neq 0$, and these can never be conjugate to semisimple elements. (With the same argument, nothing like that can ever be true for complex semisimple Lie algebras.) On the other hand, if $\mathfrak{g}$ is compact, all elements in it are semisimple, hence each of them is contained in some CSA, and all CSA's are conjugate.
*Now, your examples are not semisimple, but reductive, so they are direct products of semisimple ones ($\mathfrak{su}(n)$ and $\mathfrak{so}(n)$) with a (in this case, one-dimensional) center. Since the centre is contained in any CSA and fixed under conjugation, this does not change anything significantly.