When you rub a piece of iron along a magnet, the north-seeking poles of the atoms in the iron line up in the same direction. The force generated by the aligned atoms creates a magnetic field. The piece of iron has become a magnet. Some substances can be magnetized by an electric current.