We do not completely understand the mechanism, but it seems to have much to do with the fact that the core of the Earth has a component that is rotating and a good conductor of electrical currents. These currents come from atoms that have lost some of their electrons because of the enormous pressures there. The electrons flow with the rotating core and set up the main component of the geomagnetic field we see at the surface, and which extends out into space. Some think that convective currents in the core cause the 'polar' magnetic field to undergo topology change perhaps the way we see the Sun's magnetic field operate during its cycles. Simple formulae derived from the electrodynamical equations of such a system yield a polarity reversal time that depends on the conductivity and rotation of the body. For the Sun, these factors lead to a short 11-22 year reversal time, for the Earth you get reversal times in the 100,000 year range. During the last 20 million years the fossil record shows 60 reversals, and that the period between reversals seems to be slowly decreasing and getting shorter. But, looking at the Sun again, we know that for some systems, these reversals can abruptly stop for many cycles. This happened during the Maunder and Sporier Sunspot Minima in the 1600s. We don't know if the Earth is like this or not.
All answers are provided by Dr. Sten Odenwald (Raytheon STX)
NASA IMAGE/POETRY Education and Public Outreach program.