Explained: Sudden Motion Sensor
Apple starting using the system in 2005 and by 2006 all Mac laptops incorporated the technology.
There is an accelerometer (similar to the iPhone) that detects sudden movement. Once the accelerometer detects sufficient movement, the system disengages the drive heads from the disk platters. Think of the hard drive as a record player that when dropped is told by the SMS to lift the needle off the record to keep it from getting scratched on impact.
There has been some confusion because some hard drives have similar technology built into the drive. Sometimes SMS needs to be disabled to allow these aftermarket hard drives to work so the systems do not cause a conflict (kernel panic.) Also other manufacturers like HP and Dell have similar technologies that go by different monikers.
While these sensors do not fully protect against data loss in an impact or fall, they definitely help reduce the chance of damage and loss.
Check out MacSaber for a fun application of the technology.