There are two main stages of rapid eye movement (REM) sleep and deep sleep (a sleep stage other than REM sleep) sleep process.
REM sleep plays an important role in improving memory, cognition, and mood-related functions, and usually occurs in shallow sleep conditions. During this time, brain activity is fast, and the rapid eye movement has a fast heart rate and breathing. When you wake up, you often move and dream as if you are awake.
Deep sleep plays an important role in improving functions related to physical strength recovery. Brain activity is slow at this point, heart rate, and breathing are slow, and it is common to move slowly when you wake up.
During sleep, our brain repeats REM and deep sleep and typically REM sleep accounts for 25% of all sleep and deep sleep accounts for 75% of all sleep.