Earth has a large-scale axial dipole magnetic field, a fact of historical importance because of the role of the magnetic compass in the exploration of our planet. The geodynamo is driven by convection in the planet's fluid outer core. A long-standing question in dynamo theory is whether the preference for the axial dipole is due to a purely hydrodynamic process influenced by planetary rotation or due to a magnetohydrodynamic process influenced by both rotation and the self-generated magnetic field. Answering this question also helps us constrain the parameter space that admits polarity reversals in a dynamo. Our recent studies have focused on the role of magnetostrophic waves, which are produced from localized balances between the Lorentz, Coriolis and buoyancy (MAC) forces in the core. While these waves are essential for dipole formation, the suppression of these waves under strong forcing results in magnetic polarity transitions, including reversals. We extend these ideas to two-component thermochemical convection in terrestrial planets.