As the rocks cool from lava, for instance at the deep mid-ocean ridges where the earth「s surface plates are formed, crystals line up with the direction of the magnetic field.
This is part of the system of mid-ocean ridges that form as the tectonic plates of the Earth」s crust move apart-a process known as sea floor spreading.