Who will save science from the scientists? I often ponder that question when I peruse the writings of evolutionary psychologists—and did so once again as I read Jesse Bering’s new book, which is at once marvelously informative and endlessly infuriating.

Bering wants to spread the word that belief in a personal God—along with concomitant ideas about the existence of purpose, providence, an afterlife, and a cosmic support for justice—is an “adaptive illusion.” His originality lies not in his confident insistence that such beliefs are groundless—a view that has been defended over and over again in recent years in a series of bestselling books—but rather in the first half of his claim; he contends that theological beliefs serve a crucial evolutionary function. The bulk of his book is devoted to establishing this point, drawing on a wide range of findings in the cognitive sciences to back it up.

Bering, who serves as the director of the Institute of Cognition and Culture at the Queen’s University in Belfast, does an excellent job of elucidating these findings. (He is the author or co-author of several of the studies he cites.) As he patiently and absorbingly explains, experiment after experiment has shown that human beings are cognitively predisposed, often from early childhood, to detect signs of order, purpose, and justice in the world. We find it nearly impossible to conceive of our own annihilation, which easily leads to thoughts about the immortality of the soul. All of which means that “contrary to what many atheists tend to believe . . . at least some form of religious belief and behavior would . . . probably appear spontaneously on a desert island untouched by cultural transmission.” Humanity, it seems, is evolutionarily hard-wired for God.

All of this theological thinking is made possible by what Bering calls our “theory of mind”—the uniquely human ability to notice and reflect on the agency and intention of other minds. This capacity is so fundamental to human perception and experience that we have a hard time even noticing it. The capacity functions constantly, and it kicks into high gear when another person’s behavior defies our expectations: when a man on the street asks you a question that makes no sense, or when a friend flies into a rage at what seems to be no provocation.

In such situations, our brains furiously seek to make sense of the behavior by attempting to determine the intention of the mind behind it. The instinctual drive to look for this agency and intention is so strong, in fact, that we sometimes find ourselves attributing mindfulness to inanimate objects—the chair we kick in retributive anger after we trip over it—and even to nothing at all. That is where God comes in. Human beings feel that things happen for a reason, that their lives and their triumphs, failures, and tragedies matter in some larger sense; and their theory of mind allows them to trace this sense of cosmic meaningfulness to the presence of a divine agent that watches over and cares for them—even in the absence of any scientifically verifiable evidence of its existence.