The brain activity capable of formulating such dreams, rare among literate people in later eras, conforms to the bicameral mentality hypothesized by Julian Jaynes as dominant into the second or first millennium BCE. Framing the dream experience varies across cultures as well as through time. Dreaming and sleep are intertwined. Dreams occur mainly in the rapid-eye movement (REM) stage of sleep—when brain activity is high and resembles that of being awake. Because REM sleep is detectable in many species, and because research suggests that all mammals experience REM, linking dreams to REM sleep has led to conjectures that animals dream. However, humans dream during non-REM sleep, also, and not all REM awakenings elicit dream reports. To be studied, a dream must first be reduced to a verbal report, which is an account of the subjects memory of the dream, not the subjects dream experience itself. So, dreaming by non-humans is currently unprovable, as is dreaming by human fetuses and pre-verbal infants. Subjective experience
Preserved writings from early Mediterranean civilizations indicate a relatively abrupt change in subjective dream experience between Bronze Age antiquity and the beginnings of the classical era.In visitation dreams reported in ancient writings, dreamers were largely passive in their dreams, and visual content served primarily to frame authoritative auditory messaging. Gudea, the king of the Sumerian city-state of Lagash (reigned c. 2144–2124 BCE), rebuilt the temple of Ningirsu as the result of a dream in which he was told to do so.
Drawing on this knowledge, textbook author James W. Kalat explains, "[A] dream represents the brains effort to make sense of sparse and distorted information.... The cortex combines this haphazard input with whatever other activity was already occurring and does its best to synthesize a story that makes sense of the information." Neuroscientist Indre Viskontas is even more blunt, calling often bizarre dream content "just the result of your interpreter trying to create a story out of random neural signaling." Theories on function
For humans in the pre-classical era, and continuing for some non-literate populations into modern times, dreams are believed to have functioned as revealers of truths sourced during sleep from gods or other external entities. Ancient Egyptians believed that dreams were the best way to receive divine revelation, and thus they would induce (or "incubate") dreams. They went to sanctuaries and slept on special "dream beds" in hope of receiving advice, comfort, or healing from the gods. From a Darwinian perspective dreams would have to fulfill some kind of biological requirement, provide some benefit for natural selection to take place, or at least have no negative impact on fitness. Robert (1886), a physician from Hamburg, was the first who suggested that dreams are a need and that they have the function to erase (a) sensory impressions that were not fully worked up, and (b) ideas that were not fully developed during the day. In dreams, incomplete material is either removed (suppressed) or deepened and included into memory.