"Because of changing temperatures and fluid flows, the strength of the magnetic field varies, and the positions of the north and south magnetic poles shift.
These shifts leave traces in rocks. When lava cools, metal oxide particles within the rock become frozen in the direction of the prevailing magnetic field. So scientists can work out the historic positions of the magnetic poles by examining and dating lava samples.
As a result we know there have been about 170 magnetic pole reversals during the last 100 million years, and that the last major reversal was 781,000 years ago."