A metal detector operates by electromagnetic induction.
A metal detector generates a magnetic field, which creates an electric eddy current within any piece of metal passing through the magnetic field. The electric currents also produce a magnetic field, and this is what is used by the metal detector to seek out metallic objects.
Two common types of metal detectors are single coil and double coil.