It picks up the ultrasound they emit while hunting (they home in on insects very quickly using echolocation) and converts it to audible sound. There are 2 main methods used for this: hetrodyining and frequency division. My detector uses the latter. Essentially you amplify the sound and count the zero crossings then output a wave which changes polarity at every nth crossing (where n is your chosen divisor).
It is also possible to identify the species from the frequency (hetrodyne detectors are better for this since they have an analogue range). Common and Soprano Pipstrels are the 2 most common species where I am and there is about 10kHz difference between them