A night of sleep cycles through non-REM stages (light sleep, deeper sleep, and slow-wave deep sleep) and REM sleep, usually about every 90 minutes. Deep non-REM sleep is linked to physical restoration and memory consolidation, while REM sleep is when most vivid dreaming happens and is thought to support emotional processing and learning.
Early in the night deep sleep dominates, and REM periods grow longer toward morning. Scientists still debate the exact purpose of each stage, but disrupting them is associated with poorer memory, mood and alertness.