The 'On-body detection' feature essentially keeps the device unlocked (once unlocked) till the time user is holding it or is near the body (pocket or handbag). This is helpful when you leave the device somewhere and as soon as it goes out of your body's proximity it gets locked, even before the sleep and lock time.
Unfortunately the new On-body detection smart lock feature cannot differentiate between different bodies, so when you hand an unlocked smartphone with the feature enabled to someone it will stay unlocked. Also, if users have Trusted devices or Trusted places features enabled alongside, the device may stay unlocked even after it is out of proximity.
"This feature uses you device's accelerometer to detect whether your device is still being carried on the body. If your device detects that it's no longer being held, your device won't stay unlocked [..] If you unlock your device and hand it to someone else, your device also stays unlocked as long as the other person continues to hold or carry it," reads the On-body detection feature's brief note.
The feature is also reported to be working for non-Nexus devices running versions higher than Android 5.0 apart from the latest Google Play services version 7.0.97.
To remind you, Google during the MWC 2015 trade show introduced the Google Play Services 7.0 with new APIs for developers. Notably, the search giant launched its Google Play Services 6.5 last year in November.
(Also see: How to Activate WhatsApp Voice Calling)