These iron atoms usually point in all different directions, so the iron has no net magnetic field. But when you hold a magnet up to the iron, the magnet makes the iron atoms line up. These lined-up atomic magnets turn the iron into a magnet. The iron is then attracted to the original magnet. High temperatures can disturb this process of magnetization.
Thermal energy makes the iron atoms jiggle back and forth, disturbing their magnetic alignment.
When the vibration of the atoms becomes too great, the atomic magnets do not line up as well, and the iron loses its magnetism. The temperature at which this occurs is called the Curie point Inside the earth, there is a core of molten iron. This iron is at a temperature above the Curie point and therefore can't be magnetized. Yet the earth is magnetized, with a north and a south magnetic pole. The magnetic field of the earth comes from an electromagnet, that is, from electrical currents flowing inside the liquid metal core.