It is a very simple sensor. There is a wire embedded in the pad which wears through as the pad wears down. When the wire wears all the way through, the sensor tells the dashboard computer 'I'm broken'. Nothing complicated. And of course, it won't tell you anything about disk wear, which is checked by measuring how thin the disks are face-to-face, not something that is easily done in-car. Not impossible, mind you, just not cheap...
I think I have pics somewhere around of these things in new and worn state. Not a lot to see, mind.
Also, worth keeping the lead from a worn pad, then if you should decide to go for aftermarket pads that don't have sensors you can just join in to out on the old lead and plug it in to keep the dash happy.