Let $ G $ be a Lie group, $ H $ a closed subgroup, and $ G/H $ compact. Under what conditions do we have that $$ G/H \cong K/(K\cap H) $$ where $ K $ is a maximal compact subgroup of $ G $? Obviously the result is trivial if $ G $ is compact.
If $ G=\mathbb{R} $ and $ H=\mathbb{Z} $ this is not true. I guess that is because $ \mathbb{Z} $ is not the real points of a linear algebraic group. As long as $ G $ and $ H $ are real linear algebraic groups and $ G/H $ is compact do we have $ G/H \cong K/(K\cap H) $ ?
EDIT:
I poked around more on the internet and it looks like my example of $ \mathbb{Z} $ in $ \mathbb{R} $ generalizes to a whole class of cocompact but not Zariski closed lattices in nilpotent lie groups and these things called (compact) nilmanifolds which are all iterated torus bundles that can be realized as a nilpotent Lie group mod a cocompact lattice (e.g. Heisenberg group mod integer Heisenberg group). Nilpotent Lie groups are not compact so the maximal compact has strictly smaller dimension and thus cannot act transitively on a compact nilmanifold (since it is just $ G $ mod a lattice and thus has same dimension as $ G $).
I think a more complicated but vaguely similar story holds when generalizing to all solvable lie groups and (compact) solvmanifolds. So lots of solvable Lie groups have non Zariski closed cocompact subgroups and the resulting homogeneous spaces are not acted on transitively by the maximal compact subgroup.
Anyway that's a bunch of no go results...now let's talk sufficient conditions.
Thanks to Ycor for the argument that if $ H $ is Zariski closed cocompact then $ K $ still acts transitively on $ G/H $.
There was claim in this question
https://math.stackexchange.com/questions/2043479/homogeneous-space-of-sl3-r/2043623#2043623
that if a compact simply connected manifold is homogeneous for a Lie group $ G $ then it is also homogeneous for the maximal compact subgroup of $ G $. I'm a bit surprised by this fact. Can anyone provide an argument or reference for this fact?