We might well conclude that we need dreams when their function is considered. During sleep we have certain periods where the eyelids move rapidly as if action is occurring underneath them This is called rapid eye movement (REM) and therefore, these periods of sleep are called REM sleep. The cortex of the limbic lobes is very active, these areas being ones where episodic autobiographical memory occurs.
By contrast, there is inaction in the frontal lobes where logic, free will and voluntary recognition occur. Dream features occurring during these periods sometimes, perhaps often, replicate features occurring in certain neurological conditions. Somehow, our brain forms the dream content into some kind of story with personal emotional elements. While dreaming, we are convinced that what we are ´seeing´ is real. It is an alternative reality, sometimes with high emotive content, that reflects our true interests, anxieties, even personality.
Even when dreams are frightening, we rarely remember dream content for more than a few minutes after wakening. Our normal awareness of stimuli and reasoning takes over. Dreaming performs the function of replaying experiences in a different form helping us to process experience. It can enable learning or preparation for future events. It is a normal process that appears to be necessary for our well-being.
I am not sure scientists really know exactly how dreams work. They have been conducting research for years, trying to explain the purpose and function of dreams. In neurological terms, scientists do know that most of the parts of the brain are involved in dreaming. They also know some neurotransmitters increase when a person is dreaming.
For example, dopamine and acetylcholine are neurotransmitters that carry messages between brain cells. By studying the effects of lower than expected levels of these neurotransmitters during sleep cycles, scientists know the neurotransmitters are necessary for dreaming, but the exact nature of the connections is uncertain.