How does in-pocket detection work? My Droid Bionic has an option on the Display Settings page "In-Pocket detection: locks your device automatically when inserted in pocket"

How does the phone sense that it's in your pocket?  I'm speculating maybe a combination of proximity and light sensors?
There is an infrared/red-light sensor near your camera that detects whether the phone is in a pocket or bag. Online consensus is that depending on your phone manufacturer, there are varying degrees of success to how well it works.