Dreaming is thought to be a universal part of the human experience. Dreams can be unremarkable and unmemorable. They can perplex, bring joy, or even terrify. Sometimes they recur for years on end. Some people even feel haunted by their dreams.

For as long as people have been dreaming, they’ve been trying to figure out the meaning, purpose, and process behind dreams. The meaning and purpose remain a mystery, though there are many often competing theories. However, there are some answers as to how dreaming occurs.

To understand how dreams work, it is important to understand the basics of how sleep works. Sleep occurs in a total of four stages and two types.

Stage one is light, short sleep. Eye movement is slow and theta waves happen in the brain. In stage two, the muscles in the body relax. The brain experiences rhythmic waves called sleep spindles, and short high-amplitude waves called K-complexes. In stage three, the brain experiences delta waves and responds less to outside forces, making it harder for a person to be woken up. These three stages make up the first the of sleep, called non-rapid eye movement sleep. Stage three is the deepest stage of NREM sleep.

Stage four is the most active stage of sleep and the stage where most dreams occur. It is called REM sleep, after its primary characteristic, rapid eye movements. Eye movements aren’t the only source of activity during this stage. A brain in REM sleep is as active as an awake brain. There are also physiological changes in breathing, heart rate, body temperature regulation, and blood pressure during this stage. It is possible to also dream during NREM sleep, but those dreams tend to be less vivid and less memorable than dreams during REM sleep.

There are some people, approximately 1 in 250, who claim that they do not dream at all. It is believed that most of these people dream and simply don’t remember it. This lack of memory could be due to the hippocampus, the portion of the brain responsible for memory creation and retention, being less active during sleep. It could also be due to changes in levels of neurotransmitters like acetylcholine and norepinephrine that occur during sleep.