The mechanics of sleep cycles
Healthy human sleep is not a flat state of rest. Instead, it is divided into repeating cycles of light sleep, deep sleep, and REM (Rapid Eye Movement) sleep. Each full cycle lasts approximately 90 minutes on average.
Waking up at the end of a completed cycle is associated with feeling alert and refreshed. Conversely, waking up in the middle of a deep sleep phase can trigger sleep inertia, causing grogginess that lasts for hours.