A writer for Well+Good describes what happens during REM rebound.
Our most fantastical or conceptually rich dreams tend to happen during the final of four sleep stages, which is called REM (aka rapid-eye movement) sleep. As you cycle through the sleep stages over the course of the night, this REM stage increases in length, reaching its maximum length shortly before you wake up. When you get less sleep than the optimum 7 to 8 hours, however, that typical progression is also cut short, and the REM portion often takes the biggest hit—such that when you finally do catch up on sleep, it returns with a vengeance, bringing with it more intense dreams in a phenomenon called REM rebound.
To grasp how, exactly, REM rebound occurs and why it can deliver such vivid dreams, it’s helpful to know how REM typically shows up (when it’s not rebounding). On a night of average sleep, in which you’re not making up for any sleep deprivation, you’d typically get five minutes of REM at the end of the first 90-minute sleep cycle, 10 minutes at the end of the second, and so on, until you’re getting somewhere around 45 minutes at the very end of the night, which is when you’d experience most dreaming, says psychologist and dream scientist Rubin Naiman, PhD. “In this case, you’re rhythmically moving through all the stages of non-REM sleep, being dipped into more profound levels of serenity and deep sleep before the dreaming process really begins,” he says.
By contrast, once you start to experience some sleep deprivation—say, cutting back from your usual seven hours of sleep to five hours per night for a few nights in a row—the body starts to prioritize deep sleep (the last stage of non-REM) over REM, says Dr. Naiman, leading you to experience shorter and shorter periods of REM sleep. (The same is true if you’re frequently waking up during the middle of the night, which often happens right at the onset of REM, essentially cutting it off and bringing you back to the beginning of your sleep cycle whenever you fall back asleep, Dr. Naiman adds.)