Different metal detectors work in various different ways, but here's the science behind one of the simpler kinds. A metal detector contains a coil of wire (wrapped around the circular head at the end of the handle) known as the transmitter coil. When electricity flows through the coil, a magnetic field is created all around it. As you sweep the detector over the ground, you make the magnetic field move around too. If you move the detector over a metal object, the moving magnetic field affects the atoms inside the metal. In fact, it changes the way the electrons (tiny particles "orbiting" around those atoms) move. Now if we have a changing magnetic field in the metal, the ghost of James Clerk Maxwell tells us we must also have an electric current moving in there too. In other words, the metal detector creates (or "induces") some electrical activity in the metal. But then Maxwell tells us something else interesting too: if we have electricity moving in a piece of metal, it must create some magnetism as well. So, when you move a metal detector over a piece of metal, the magnetic field coming from the detector causes another magnetic field to appear around the metal.
METAL DETECTOR ACCESSORIES
It's this second magnetic field, around the metal, that the detector picks up. The metal detector has a second coil of wire in its head (known as the receiver coil) that's connected to a circuit containing a loudspeaker. As you move the detector about over the piece of metal, the magnetic field produced by the metal cuts through the coil. Now if you move a piece of metal through a magnetic field, you make electricity flow through it (remember, that's how a generator works). So, as you move the detector over the metal, electricity flows through the receiver coil, making the loudspeaker click or beep. Hey presto, the metal detector is triggered and you've found something! The closer you move the transmitter coil to the piece of metal, the stronger the magnetic field the transmitter coil creates in it, the stronger the magnetic field the metal creates in the receiver coil, the more current that flows in the loudspeaker, and the louder the noise.