Are you human? Then at some level you believe in magic. Specific beliefs about miracles and other kinds of magic may get handed down within a religious or cultural tradition, but we all are prone to magical thinking, even the most rigorous scientist or die-hard skeptic. At least that’s what psychological research suggests. In carefully structured experiments, people who don’t consciously believe in magic behave as if they unconsciously do.

Our tendency toward magical thinking derives from the structure of human cognition. Types of thinking that help us survive and thrive—like pattern matching, seeking cause-and effect-relationships, and attending to unusual events—also incline us to specific glitches in rationality. Understanding these flaws in human information processing makes it easier to understand why so many people see miracles and other kinds of magic in the world around us.

Snap judgments about cause and effect – When two things happen close in time or close in space without an obvious external cause, we tend to assume that one caused the other, instinctively equating correlation and causation. Our brains are constantly scanning for causes and effects; and we pair them up quickly, often before conscious processing can take place.

The evidence can be seen in magnetic resonance images according to neuroscientist Ben Parrish. When people watch a magician make a coin disappear, activity spikes immediately in the part of the brain that generates hypotheses about uncertain situations.

If aphids infest your rose bush and the leaves curl up, it is useful to suspect that one likely caused the other. But the same associative process is not so helpful when your brain tells you that a rabbit appeared from a hat because a magician waved his wand or that your headache went away because you prayed.

Paranoia (also known as agenticity, hyperactive agency detection or hyperactive intentionality detection) – The human mind puts inanimate objects and active agents in two very different categories. While inanimate objects are interchangeable, we treat agency as if it comes from an internal essence, a unique living force. But sometimes we get these categories crossed.

While we rarely treat humans as if they were inanimate objects, the opposite is not true. For example, young children are quick to treat a stuffed animal as if it were a living thing. One of the most beloved children’s stories in the English language is The Velveteen Rabbit, in which a stuffed rabbit becomes flesh and blood because he is loved by a child. We also tend to think by default that sounds and events were caused intentionally by a conscious agent. “He did it on puuurpose!” a young child wails when an older brother hurts them, whether it is true or not.

Research shows that infants tend to assume the presence of an active agent or intentionality whenever they see non-inertial movement. This would have had survival value for our ancestors. In the words of neurologist Steven Novela,

“We are descended from hominids who were more paranoid and had hyperactive agency detection, because they were less likely to be eaten by predators.

“We can extrapolate from “non-inertial movement”, or movement that cannot be easily explained as a passive reaction to natural forces, to more and more complex “actions.” [Hyperactive Agency Detection Device] detects more than movement, it can detect a pattern in otherwise unrelated events, details that defy easy explanation, or consequences that seem out of proportion to the alleged causes. When HADD is triggered we tend to see a hidden agent working behind the scenes, making events unfold the way they do, and perhaps even deliberately hiding its own tracks.”

We humans are social animals, and as our ancestors sought to understand natural events, it was natural to interpret them in social terms. It is still natural for us to do so today.

Apophenia (also known as patternicity) – Our relentless search for patterns is one of humanity’s greatest cognitive strengths. It defines who we are as a species, and it is fundamental to the explosion of human life across the planet. But it also means we have a tendency to see connections in unrelated events.

Apophenia underlies conspiracy theories and many kinds of parapsychology. Taken to an extreme it plagues people with schizophrenia who sometimes can’t get away from the feeling that unrelated events around them are acutely meaningful. “Our greatest challenge may be learning to bear incoherence,” says psychologist Bruce Poulsen. But even when we are willing to live with uncertainty and mystery, our brains keep pulling to fill in the unknown—and religions are more than willing to help.

Pareidolia – One common type of apophenia is pareidolia, perceiving nonexistent patterns in visual and auditory input. We see and hear things that aren’t really there, even in white noise or random forms like ink blots.

One former meth addict describes how drug use gradually turned background noise into intelligible messages. When things go wrong with neurotransmitters, as in schizophrenia, the same progression can happen to people who aren’t using drugs.

But nothing has to be wrong with our brains for us to see meaningful patterns where they don’t actually exist. Every child has seen a rabbit in a cloud or a monster in the shadow cast by moonlight through a bedroom window. The marbled stone on my bathroom floor contains the image of a rocket ship or flying penis, or swimming amoeba; members of the household don’t agree on which, but we all see something in that tile.

The most common kind of pareidolia is the tendency to see faces in inanimate objects. Infants respond to two black dots and a slash as a human face, suggesting that parts of our brain are highly tuned for recognizing and interpreting facial information. It should come as no surprise, then, when people see the faces of Jesus, Mary and devils in objects as disparateas a Cheeto, a banana skin, an ancient shroud, or even a dog’s bum. Miraculous? No, but it’s only natural that we think so.

Attraction to unusual or counter-intuitive events – We habituate to the familiar, but the unexpected captures our attention. This thought pattern is highly efficient, because it means we aren’t squandering mental energy on things that stay the same. Instead, we can attend to whatever is moving or changing or novel or puzzling.

This tendency helps us to stay safe (to avoid getting run over one needs to focus on the one moving car in an otherwise static landscape), and it helps us to make discoveries. As Isaac Asimov famously said, “The most exciting phrase to hear in science, the one that heralds new discoveries, is not “Eureka!” (I found it!) but “That’s funny …”. Unfortunately, this means we also love to tell stories that violate the expected, stories about the exception rather than the rule—including miracle stories.

Poor statistical intuition and reasoning – We humans are terrible at predicting the likelihood of rare events, which can make common occurrences seem miraculous. Most events that people experience as “miraculous” are predictably common given real-world base rates and population sizes, but that is not how they seem.

Our intuitive statistics so wildly miss the mark that an entire book could be written about how readily we get wowed and seek extraordinary explanations for events that we perceive as rare but actually aren’t. In fact, books have been written on this topic, and to do it justice I will dive in later. Suffice to say that people who believe in paranormal phenomena appear to do worse at statistical inference than others.

Glitches like these—and others—lay the foundation for seemingly supernatural and paranormal experiences. Our ancient ancestors may have seen magical beings in the world around them. Religious people may find miracles in recovery from cancer or empty parking spots. New Agers may turn quantum theory into woo. Psychics and paranormal aficionados may convince themselves that they’re onto something. But don’t get too smug. Really, when it comes to magical thinking, we’re all in this together.

(Like this? Read Part 3 here or subscribe for Part 5 of this 7-part series.)