Before John Lennon imagined “living life in peace,” he conjured “no heaven … / no hell below us …/ and no religion too.”

No religion: What was Lennon summoning? For starters, a world without “divine” messengers, like Osama bin Laden, sparking violence. A world where mistakes, like the avoidable loss of life in Hurricane Katrina, would be rectified rather than chalked up to “God’s will.” Where politicians no longer compete to prove who believes more strongly in the irrational and untenable. Where critical thinking is an ideal. In short, a world that makes sense.

In recent years scientists specializing in the mind have begun to unravel religion’s “DNA.” They have produced robust theories, backed by empirical evidence (including “imaging” studies of the brain at work), that support the conclusion that it was humans who created God, not the other way around. And the better we understand the science, the closer we can come to “no heaven … no hell … and no religion too.”

Like our physiological DNA, the psychological mechanisms behind faith evolved over the eons through natural selection. They helped our ancestors work effectively in small groups and survive and reproduce, traits developed long before recorded history, from foundations deep in our mammalian, primate and African hunter-gatherer past.

For example, we are born with a powerful need for attachment, identified as long ago as the 1940s by psychiatrist John Bowlby and expanded on by psychologist Mary Ainsworth. Individual survival was enhanced by protectors, beginning with our mothers. Attachment is reinforced physiologically through brain chemistry, and we evolved and retain neural networks completely dedicated to it. We easily expand that inborn need for protectors to authority figures of any sort, including religious leaders and, more saliently, gods. God becomes a super parent, able to protect us and care for us even when our more corporeal support systems disappear, through death or distance.

Scientists have so far identified about 20 hard-wired, evolved “adaptations” as the building blocks of religion. Like attachment, they are mechanisms that underlie human interactions: Brain-imaging studies at the National Institutes of Health showed that when test subjects were read statements about religion and asked to agree or disagree, the same brain networks that process human social behavior — our ability to negotiate relationships with others — were engaged.

Among the psychological adaptations related to religion are our need for reciprocity, our tendency to attribute unknown events to human agency, our capacity for romantic love, our fierce “out-group” hatreds and just as fierce loyalties to the in groups of kin and allies. Religion hijacks these traits. The rivalry between Sunni and Shiite Muslims, for example, or the doctrinal battles between Protestant and Catholic reflect our “groupish” tendencies.

In addition to these adaptations, humans have developed the remarkable ability to think about what goes on in other people’s minds and create and rehearse complex interactions with an unseen other. In our minds we can de-couple cognition from time, place and circumstance. We consider what someone else might do in our place; we project future scenarios; we replay past events. It’s an easy jump to say, conversing with the dead or to conjuring gods and praying to them.

Morality, which some see as imposed by gods or religion on savage humans, science sees as yet another adaptive strategy handed down to us by natural selection.

Yale psychology professor Paul Bloom notes that “it is often beneficial for humans to work together … which means it would have been adaptive to evaluate the niceness and nastiness of other individuals.” In groundbreaking research, he and his team found that infants in their first year of life demonstrate aspects of an innate sense of right and wrong, good and bad, even fair and unfair. When shown a puppet climbing a mountain, either helped or hindered by a second puppet, the babies oriented toward the helpful puppet. They were able to make an evaluative social judgment, in a sense a moral response.

Michael Tomasello, a developmental psychologist who co-directs the Max Planck Institute for Evolutionary Anthropology in Leipzig, Germany, has also done work related to morality and very young children. He and his colleagues have produced a wealth of research that demonstrates children’s capacities for altruism. He argues that we are born altruists who then have to learn strategic self-interest.

Beyond psychological adaptations and mechanisms, scientists have discovered neurological explanations for what many interpret as evidence of divine existence. Canadian psychologist Michael Persinger, who developed what he calls a “god helmet” that blocks sight and sound but stimulates the brain’s temporal lobe, notes that many of his helmeted research subjects reported feeling the presence of “another.” Depending on their personal and cultural history, they then interpreted the sensed presence as either a supernatural or religious figure. It is conceivable that St. Paul’s dramatic conversion on the road to Damascus was, in reality, a seizure caused by temporal lobe epilepsy.

The better we understand human psychology and neurology, the more we will uncover the underpinnings of religion. Some of them, like the attachment system, push us toward a belief in gods and make departing from it extraordinarily difficult. But it is possible.

We can be better as a species if we recognize religion as a man-made construct. We owe it to ourselves to at least consider the real roots of religious belief, so we can deal with life as it is, taking advantage of perhaps our mind’s greatest adaptation: our ability to use reason.

Imagine that.

J. Anderson Thomson is a psychiatrist at the University of Virginia. He serves as a trustee of the Richard Dawkins Foundation for Reason and Science. Clare Aukofer is a medical writer. They are the authors of “Why We Believe in God(s): A Concise Guide to the Science of Faith.”