A new theory has emerged that links dream content with belief in deities and other “supernatural agents.” Evidence from sleep and anthropological research suggests the ways dreams manifest themselves in the brain directly contributes to people’s conviction in gods and other spiritual beings.

Patrick McNamara of Boston University’s School of Medicine and Kelly Bulkeley at the Graduate Theological Union in Berkeley, California, co-authored the theory, which was published in Frontiers in Psychology in March.

The researchers believe this process begins with REM sleep, during which the prefrontal cortex’s ability to interpret and credit the “self” as responsible for feelings and actions is diminished. This “REM-associated diminution of agency” involves dreamers surrendering their ownership of experience to the characters in dreams.

These characters and their actions are very memorable due to their “counterintuitive” nature—their designs and behaviors are perfectly calibrated between absurdity and believability. Combined, these factors produce sustained conscious belief in a supernatural entity that originated in the dreamer’s mind.

Preliminary evidence also suggests that dreams function as “simulated” state where the dreamer can “play out” future scenarios or reimagine previous ones. The dreamer’s ownership of subjective experience is weakened while dreaming, which may explain many believers’ conviction that some “other force” is communicating with them or guiding their waking lives.

While this may sound farfetched, the dream-deity connection is not a radical proposition. The idea of dreams as a “primary source for religious ideas and practices” has roots in humanity’s ancient past. Cave art dating back 28,000 years depicts supernatural figures (human-animal hybrids) and shamans induced in sleep/dream trances. Ethnologists agree that most religious traditions emphasize the existence and significance of visions and dreams. The authors cite the Bible’s Jacob and Japan’s Lady Serafina as two pivotal examples.

This shared cultural connection to spirituality may share a neurological origin in dreams. “All humans,” the study authors write, “are endowed with brains innately primed to daily generate god concepts in dreaming.”

Value-formation in dreams is another key ingredient of deity belief. A wealth of studies have reported how chemicals and structures in the limbic system and amygdala directly produce value formation. These systems are active during the REM stage of sleep, suggesting that the pursuit of value in dreams (achieving something positive, avoiding something negative) mirrors the pursuit of value believers engage in with their deity of choice.

Dream content during REM also tends to be more bizarre, illogical, and emotional than non-REM content. Reports of benign or helpful dream characters most occur during non-REM sleep while negative or evil “spirits” reign during REM. Negative themes and themes of “victimization” (running away from danger) occur in over 65% of all dreams, while positive or successful dream outcomes happen less than 50%. The researchers believe feelings of reduced agency in dreams are the result of the diminution process, which then lead to a strengthened belief in a god.

Lastly, the researchers reference “REM intrusion,” the condition of experiencing a delusional dream-like state while awake, as more evidence for dream content affecting real-world beliefs. This is common in people with schizophrenia and can also result from sleep-deprivation.

“Although dreams are difficult to study scientifically,” write McNamara and Bulkeley, “the sheer fact of their scientific and cultural ubiquity makes them an important topic for brain-mind research.” They posit that the cultural and neurological clues surrounding agency and sleep “naturally lend themselves to attributions of special powers to ‘special characters/beings’ in dreams and therefore to religious meaning and purpose.”