Dreams are not confined to REM sleep
Dream reports are especially vivid and frequent during rapid-eye-movement sleep, but people also report dreams from non-REM sleep. Brain activity in posterior cortical regions can help predict whether a sleeper is experiencing a dream, showing that dreaming is a measurable state rather than simply a synonym for REM sleep.
Sleep clearly does work that matters
Sleep supports memory consolidation, learning capacity and neural restoration. NIH-funded work continues to show that sleeping brains reactivate and reorganize memories, and targeted cues during sleep can bias which memories are strengthened.
That does not settle what dreams are for
Dream content may reflect fragments of memory processing, emotional regulation, threat simulation, spontaneous internally generated activity or several processes at once. Current evidence does not establish one exclusive adaptive function for dream narratives.
Forgetting may be part of the story too
Animal research has identified REM-active neural systems that can weaken newly formed memories. That makes a simple 'dreams exist to store memories' account too narrow: sleep can strengthen some information while suppressing or discarding other information.
Research record
NIH — Exploring Dreams and MemoryOfficial · open sourceNICHD — What happens during sleep?Official · open sourceNIH/NINDS — The brain may actively forget during dream sleepOfficial · open sourceWhat Are Dreams For?
Direct answer: We do not yet know one definitive function of dreams. Sleep has established roles in memory and brain restoration, and dreams are plausibly entangled with those processes, but the dream narrative itself has no single proven purpose.
Dreaming is real and biologically structured; its universal function remains unresolved. Memory and emotional-processing accounts are plausible research programmes, not settled explanations.