What’s going on in your brain when you dream? Are your sleeping thoughts random and meaningless? Or are your dreams trying to tell you something? To get answers, we talked to Ben Rein, a neuroscientist at the Stanford School of Medicine and a content creator with over 700,000 followers on TikTok.

Rein became a neuroscientist because of a horrifying nightmare he had. He couldn’t believe his brain could generate such imagery and make him believe all of his experiences were real while he was dreaming. “I was awed by the power of the brain,” he says.

Watch this to learn more, with Part 4 of our neuroscience expert series.

preview for Your Dreams Are Preparing You for Future Threats

Your Brain Simulates Responding To Threats During Nightmares

Regardless of culture, it seems like we all share certain universal nightmares, like falling from the sky or being late for school. Neuroscientists still don’t understand the full purpose of dreaming. They do know it helps memory consolidation is critical for restful and effective sleep.

So what’s the purpose of scary dreams? “There’s a theory of dreaming that it serves an evolutionary purpose. Dreams—or nightmares specifically—allow you to simulate threatening experiences,” Rein says. Since you don’t know you’re only dreaming of being in danger, it’s like a simulation in which you’re fully engaged, so “maybe you can learn how to behave in that situation and prevent your death in that actual scenario,” Rein explains.

Back in the day, our main source of danger would have been something like running from a predator. So dreams about being hunted would have had a purpose. “Nowadays, the brain may have this deep, primitive drive to simulate threatening experiences,” Rein says. A more likely contemporary threat may be something that damages our reputations, so a nightmare about walking naked into a public space for instance produces a fear response. “Maybe this old system is now being hijacked by the demands of modern life to result in us simulating these experiences that are not really threatening for survival, but are just threatening and scary in general,” Rein says.

Are Your Dreams Trying to Tell You Something?

Dreams don’t have an inherent meaning, Rein reassures us. They’re not trying to reveal some hidden truth. However, when you do wake up, you may feel you need to assign a meaning to the actions or imagery in your dreams. Rein says the true value of your dreams comes from giving you a fresh perspective on some situation in your life or a problem you’re struggling to solve.

“So I think insights can come from dreams, but I’m not necessarily sure dreams themselves make sense or matter,” Rein says. Besides, those who study dreaming also speculate that dreams can also represent random or nonsensical brain activity. So don’t worry your dreams are trying to tell you something. Just enjoy the fact that your brain can make you think, even while you’re asleep.