Small grains of magnetite in volcanic rocks are fossilized compasses that lock in the orientation of magnetic fields when they cool.

Some magnetic grains cool in the complete opposite direction. This means that the north pole was once at the south pole due to Magnetic Reversal