The exchange interaction is also responsible for the other types of spontaneous ordering of atomic magnetic moments occurring in magnetic solids, antiferromagnetism and ferrimagnetism.
From the en.wikipedia.org
The past magnetic field is recorded mostly by iron oxides, such as magnetite, that have some form of ferrimagnetism or other magnetic ordering that allows the Earth's field to magnetize them.