While you’re snoozing, your brain is using NREM and REM sleep to strengthen and sort your memories for you.