Your brain stays active while you sleep.
During REM sleep, brain waves look more like they do when you’re awake.
A night of sleep cycles through non-REM and REM stages. Brain waves slow as you enter deeper non-REM sleep. In REM sleep, their pattern becomes more like the one seen during wakefulness.
Most dreaming happens during REM sleep, but dreams can occur in non-REM sleep too.