Magnets attract metals like iron, nickel, and cobalt because of an invisible magnetic field. Magnetic objects can't resist the pull of a magnet. A magnet's invisible magnetic field can travel through anything that is not magnetic. When magnetic objects are near a magnet, the invisible magnetic field can't travel through. Those invisible magnetic fields aren't very large. If a magnet is moved too far away the invisible force can't reach and won't be able to attract the metal.