The two outer electrons in the iron atom tend to line up with their spins aligned. Electrons have a magnetic moment (due to a quantum effect, the Dirac equation) that is aligned with their spin. In ferromagnetism, a cooperative quantum effect lines up all the magnetic moments in large chunks of iron producing large magnetic fields.