Great question. Here's how a cadence sensor actually works:
On regular bikes, there is a magnet (that is usually attached to a moving part like spoke/pedal) and a sensor (that is attached to the frame of the bike). In this case the sensor indeed works like a switch which turns on or off...