How do those 'metal detector' apps for your phone actually work?

Wait 5 sec.

Your phone can be turned into something of a metal detector, but don't expect the range of a dedicated machine.