The short answer
Dreams are produced by the brain during sleep. Most vivid dreaming happens during REM sleep. The brain builds dream content from material it already holds, such as memories, recent experiences and emotions, along with sensations it picks up while you sleep.
Brain activity during dreams
Brain-imaging studies have found that during REM sleep, areas linked to emotion and to vision are often active. Parts of the prefrontal cortex, which handle logic, planning and self-monitoring, are less active. That mix may help explain why dreams can be emotionally charged and visual, yet often odd, with sudden scene changes and few rules.
The brain-based account in neurocognitive dream theory example fits this pattern, although how much these patterns explain about any single dream is still open.
Where the material comes from
Dream content tends to draw on a few sources:
- Memories, including things from years ago and things from the day before.
- Current concerns, such as work, relationships or health worries.
- Sensations during sleep, such as sound, temperature or pressure, that the brain may weave into a scene.
- Emotions felt during the day, which can carry over into sleep.
Not every dream draws on all of these, and it is hard to tell from the dream itself which source mattered most.
Why researchers disagree
Researchers broadly agree on the picture above: dreams are generated by the brain during sleep, using memory and emotion. They disagree on the purpose, if there is one, and on how much a dream reflects an underlying message. Some see dreams as useful for processing experience, and others see them as a by-product of brain activity. The differences matter most when people try to read meaning into a particular dream.
A practical takeaway
You usually cannot trace a single dream to one clear source, but you can often find parts of it in your recent life. Looking at what happened the day before, what was on your mind at bedtime, and any noises or sensations during the night often accounts for some of the content. That does not rule out a deeper meaning, but it is often the most grounded place to start.