SleepSense detects your movements during the night by using your phones acceleration sensors. It keeps track of all the different phases of your sleep cycles or biorhythms to ensure that you are gently woken up during a light sleep phase, rather than a deep one.

SleepSense uses a 30 minute window before the Alarm time to attempt to wake you, at the optimal time, when you will feel rested and ready to start the day.

http://forum.xda-developers.com/showthread.php?t=705122