Thermoremanent magnetization
When an igneous rock cools, it acquires a thermoremanent magnetization (TRM) from the Earth's field. TRM can be much larger than it would be if exposed to the same field at room temperature (see isothermal remanence).
Source: Wikipedia — Thermoremanent magnetization (CC BY-SA 4.0)