Quick answer

We dream mostly in REM sleep, when the brain replays the day's experiences, files memories into long-term storage and takes the sting out of difficult emotions.

Why do we dream? Because your brain does not switch off when you fall asleep — it changes jobs. Most vivid dreams happen during REM sleep, short for rapid eye movement sleep, when the brain becomes almost as active as it is when you are awake. Your eyes dart behind closed lids, your heart rate rises, and your body is temporarily paralysed so you cannot act out what you are dreaming. Scientists still debate the exact purpose of dreaming, but the evidence points to a busy night shift: sorting memories, processing emotions and rehearsing for threats.

Adults spend roughly 20 to 25 percent of the night in REM, in cycles of about 90 minutes that grow longer towards morning. That is why the dreams you remember most often come just before waking — the last, longest REM stretch of the night.

Why do we dream about the day we just had?

The clearest job dreaming does is memory consolidation. During the day, the hippocampus acts like a scratch pad, quickly jotting down new experiences. At night it replays those recordings to the cortex, which manages long-term storage. In animal studies, researchers have watched hippocampal neurons fire in patterns that mirror the day's experiences, sometimes replaying them up to 20 times faster than real time.

This is also why sleep helps you learn. Studies have found that people who sleep after learning new material remember significantly more than those who stay awake, and people deprived of REM sleep specifically perform worse on skill-learning tasks the next day. Cutting sleep short is costly in a particular way: because the longest REM periods come late in the night, an early alarm removes the most memory-rich part of your sleep.

Dreams also process emotion. The amygdala, the brain's emotional centre, is one of the most active regions during REM — in some measures more active than during waking. Research from UC Berkeley suggests REM sleep lets the brain reprocess emotionally significant experiences in a neurochemical environment stripped of the stress hormone norepinephrine, reducing the emotional charge attached to difficult memories while keeping the facts intact.

Why do we forget most dreams within minutes?

Most dreams vanish fast — many are forgotten within five minutes of waking, and about 90 percent within ten. The hippocampus, the brain's memory recorder, is relatively inactive during REM sleep, so the dream is never properly filed. Unless you wake during a dream or deliberately note it down, it dissolves.

One leading evolutionary idea, Finnish neuroscientist Antti Revonsuo's threat simulation theory, proposes that dreaming is a safe rehearsal ground: the brain practises responses to danger while the body lies safely in bed. Whether dreams are filing cabinets, therapy sessions or rehearsals, they are not random noise. Like yawning, they are a reminder that the brain keeps working long after consciousness clocks off.