The magnetic field of the planet changes the location of its poles and the polarity over time. The rotation of the iron inner core of Earth causes the liquid outer core to rotate in turn, and they produce magnetic field lines that extend from the north and south magnetic poles.
The magnetic poles drift about 10 miles in a year and are far from the geographic poles. Magnetic fields are created partially by the convection currents in the Earth's core, but liquid does not have a set pattern of movement. Therefore, the convection currents change and the field lines move with them. Also, the magnetic field has been thought to weaken by a small amount each year, increasing Earth's exposure to cosmic radiation.
The weakening of the magnetic field is thought to indicate and impending polarity reversal. In other words, the north pole and south pole switch places, which would make compass needles point to the south pole. This has happened numerous times throughout geologic history, as shown by examining the fossil record and geological strata. There are no solid hypotheses concerning exactly why the reversal of the poles occurs, nor is there any way to predict accurately when it will occur.