You (supposedly) only move around when you're in certain sleep stages, and not others. When you're moving around, you're still asleep, but you're much more lightly asleep than when you're not moving around, so it's a much more optimal time to wake up and you can also track how "restful" your sleep is.