If the alignment of unpaired electrons persists without the application of an external magnetic field or electric current, it produces a permanent magnet. Permanent magnets are the result of ferromagnetism. read more
This creates a toroidal, or doughnut-shaped field, as the direction of the field propagates outward from the north pole and enters through the south pole. The Earth itself is a giant magnet. The planet gets its magnetic field from circulating electric currents within the molten metallic core, according to HyperPhysics. read more