Cordless drills have anti-backdrive pins built into them. They are small metal cylinders that shift when the drill head attempts to rotate when the motor is not rotating.
In fact, the window motors you have use a similar system:
http://www.chiefdelphi.com/media/papers/download/3449
Page 6 of the nothing-but-dewalts whitepaper linked above has a picture showing the anti-backdrive pins.