Faith in a higher being is as old as humanity itself. But what sparked the Divine Idea? Did our earliest ancestors gain some evolutionary advantage through their shared religious feelings? In these extracts from his latest book, Robert Winston ponders the biggest question of them all

The Dolley Pond Church of God With Signs Following was founded in Tennessee in 1909 by one George Went Hensley. This former bootlegger took to the pulpit in a rural Pentecostalist community in Grasshopper Valley. One Sabbath, while he was preaching a fiery sermon, some of the congregation dumped a large box of rattlesnakes into the pulpit (history does not record whether they were angry or just bored). Without missing a beat, in mid-sentence, Hensley bent down, picked up a 3ft-long specimen of this most venomous of snakes, and held it wriggling high above his head. Unharmed, he exhorted his congregation to follow suit, quoting the words of Christ: "And these signs will follow those who believe ... in my Name ... they will take up serpents."

News of Hensley's sermon spread through Grasshopper Valley; others joined him in handling snakes, and the practice caught on. There have since been around 120 deaths from snakebite in these churches, but most of the congregants tend to refuse medical help if they are bitten, preferring to believe that divine intervention will be more efficacious. Sadly, Hensley himself perished from a snakebite in 1955, and shortly afterwards the US government wisely acted to prevent the practice - although it is still legal in parts of the States.

Today, snake-handling continues mostly in small communities in rural areas of Tennessee and Kentucky, as well as pockets in other southern states. Participants feel that "the spirit of God" comes upon them as they open the boxes containing the snakes. Often lifting three or four of them up simultaneously in one hand, holding them high and allowing the creatures to wind around their arms and bodies, they praise God ecstatically.

To many of us, religious or not, this type of activity seems little short of outright lunacy. And it's certainly the case that religion and mental ill-health have long been linked. The disturbed individual who believes himself to be Christ, or to receive messages from God, is something of a cliche in our society. Ever since Sigmund Freud, many people have associated religiosity with neurosis and mental illness.

Many years ago, a team of researchers at the department of anthropology at the University of Minnesota decided to put this association to the test. They studied certain fringe religious groups, such as fundamentalist Baptists, Pentecostalists and the snake-handlers of West Virginia, to see if they showed the particular type of psychopathology associated with mental illness. Members of mainstream Protestant churches from a similar social and financial background provided a good control group for comparison. Some of the wilder fundamentalists prayed with what can only be described as great and transcendental ecstasy, but there was no obvious sign of any particular psychopathology among most of the people studied. After further analysis, however, there appeared a tendency to what can only be described as mental instability in one particular group. The study was blinded, so that most of the research team involved with questionnaires did not have access to the final data. When they were asked which group they thought would show the most disturbed psychopathology, the whole team identified the snake-handlers. But when the data were revealed, the reverse was true: there was more mental illness among the conventional Protestant churchgoers - the "extrinsically" religious - than among the fervently committed.

A Harvard psychologist named Gordon Allport did some key research in the 1950s on various kinds of human prejudice and came up with a definition of religiosity that is still in use today. He suggested that there were two types of religious commitment - extrinsic and intrinsic. Extrinsic religiosity he defined as religious self-centredness. Such a person goes to church or synagogue as a means to an end - for what they can get out of it. They might go to church to be seen, because it is the social norm in their society, conferring respectability or social advancement. Going to church (or synagogue) becomes a social convention.

Allport thought that intrinsic religiosity was different. He identified a group of people who were intrinsically religious, seeing their religion as an end in itself. They tended to be more deeply committed; religion became the organising principle of their lives, a central and personal experience. In support of his research, Allport found that prejudice was more common in those individuals who scored highly for extrinsic religion.

The evidence generally is that intrinsic religiosity seems to be associated with lower levels of anxiety and stress, freedom from guilt, better adjustment in society and less depression. On the other hand, extrinsic religious feelings - where religion is used as a way to belong to and prosper within a group - seem to be associated with increased tendencies to guilt, worry and anxiety.

It is possible that strong levels of belief in God, gods, spirits or the supernatural might have given our ancestors considerable comforts and advantages. Many anthropologists and social theorists do indeed take the view that religion emerged out of a sense of uncertainty and bewilderment - explaining misfortune or illness, for example, as the consequences of an angry God, or reassuring us that we live on after death. Rituals would have given us a comforting, albeit illusory, sense that we can control what is in fact ultimately beyond our control - the weather, illness, attacks by predators or other human groups.

However, it is equally plausible that the Divine Idea would have been of little use in our prehistoric rough-and-tumble existence. Life on the savannah may have been in the open air, but it was no picnic. Early humans would have been constantly on the lookout for predators to be avoided, such as wolves and sabre-tooth tigers; hunting or scavenging would be a continual necessity to ensure sufficient food; and the men were probably constantly fighting among each other to ensure that they could have sex with the best-looking girl (or boy) or choose the most tender piece of meat from the carcass. Why would it be necessary, in the daily scramble to stay alive, to make time for such an indulgent pursuit as religion?

Richard Dawkins, our best-known Darwinist and a ferocious critic of organised religion, notes that religion seems to be, on the face of it, a cost rather than a benefit: "Religious behaviour in bipedal apes occupies large quantities of time. It devours huge resources. A medieval cathedral consumed hundreds of man-centuries in its building. Sacred music and devotional paintings largely monopolised medieval and Renaissance talent. Thousands, perhaps millions, of people have died, often accepting torture first, for loyalty to one religion against a scarcely distinguishable alternative. Devout people have died for their gods, killed for them, fasted for them, endured whipping, undertaken a lifetime of celibacy, and sworn themselves to asocial silence for the sake of religion."

It seems at first glance as if Dawkins is arguing that religion is an evolutionary disaster area. Religious belief, it seems, would be unlikely, on its own merits, to have slipped through the net of natural selection. But maybe that interpretation of what Dawkins is saying neglects some of the further benefits that religion might well offer in the human quest for survival and security.

In his book Darwin's Cathedral, David Sloan Wilson, professor of biology and anthropology at Binghamton University in New York state, says that religiosity emerged as a "useful" genetic trait because it had the effect of making social groups more unified. The communal nature of religion certainly would have given groups of hunter-gatherers a stronger sense of togetherness. This produced a leaner, meaner survival machine, a group that was more likely to be able to defend a waterhole, or kill more antelope, or capture their opponents' daughters. The better the religion was at producing an organised and disciplined group, the more effective they would have been at staying alive, and hence at passing their genes on to the next generation. This is what we mean by "natural selection": adaptations which help survival and reproduction get passed down through the genes. Taking into account the additional suggestion, from various studies of twins, that we may have an inherited disposition towards religious belief, is there any evidence that the Divine Idea might be carried in our genes?

While nobody has identified any gene for religion, there are certainly some candidate genes that may influence human personality and confer a tendency to religious feelings. Some of the genes likely to be involved are those which control levels of different chemicals called neurotransmitters in the brain. Dopamine is one neurotransmitter which we know plays a powerful role in our feelings of well-being; it may also be involved in the sense of peace that humans feel during some spiritual experiences. One particular gene involved in dopamine action - incidentally, by no means the only one that has been studied in this way - is the dopamine D4 receptor gene (DRD4). In some people, because of slight changes in spelling of the DNA sequences (a so-called polymorphism) making up this gene, the gene may be more biologically active, and this could be partly responsible for a religious bent.

And it is easy to suggest a mechanism by which religious beliefs could help us to pass on our genes. Greater cohesion and stricter moral codes would tend to produce more cooperation, and more cooperation means that hunting and gathering are likely to bring in more food. In turn, full bellies mean greater strength and alertness, greater immunity against infection, and offspring who develop and become independent more swiftly. Members of the group would also be more likely to take care of each other, especially those who are sick or injured. Therefore - in the long run - a shared religion appears to be evolutionarily advantageous, and natural selection might favour those groups with stronger religious beliefs.

But this is not the whole story. Although religion might be useful in developing a solid moral framework - and enforcing it - we can quite easily develop moral intuitions without relying on religion. Psychologist Eliot Turiel observed that even three- and four-year-olds could distinguish between moral rules (for example, not hitting someone) and conventional rules (such as not talking when the teacher is talking). Furthermore, they could understand that a moral breach, such as hitting someone, was wrong whether you had been told not to do it or not, whereas a conventional breach, such as talking in class, was wrong only if it had been expressly forbidden. They were also clearly able to distinguish between prudential rules (such as not leaving your notebook next to the fireplace) and moral rules.

This would suggest that there is a sort of "morality module" in the brain that is activated at an early age. Evidence from neuroscience would back this up, to a degree. In my last book, The Human Mind, I noted that certain brain areas become activated when we engage in cooperation with others, and that these areas are associated with feelings of pleasure and reward. It also seems that certain areas of the brain are brought into action in situations where we feel empathy and forgiveness.

So religion does not seem to be produced by a specific part of our psychological make-up. Is it more likely, then, that religious ideas are something of an accidental by-product created by other parts of our basic blueprint, by processes deep in the unconscious mind that evolved to help us survive?

Shared beliefs

What identical twins teach us about religion

In the United States during the 50s and 60s,it was considered best to separate at birth twins who were to be adopted. This led to a number of these children being brought up by families who did not even know that their adopted baby had a twin; and sadly, the children themselves were brought up intotal ignorance of their "lost" twin.

Identical twins, of course, are formed in the uterus by the embryo splitting; so identical twins have exactly the same DNA.

Non-identical twins -growing from two separate eggs fertilised by different sperm - do not have identical genes, but will just share many general aspects of their genetic inheritance, as do any other brothers or sisters in one family unit.

Thomas Bouchard, professor of psychology at the University of Minnesota, recognized that these twins, if compared with each other as they grew up, would provide an important way of measuring genetic and environmental influences.

His groundbreaking work in the 1980s and 90s gave rise to some extraordinary insights into which aspects of the human condition are more likely to be due to nature, and which to nurture.

In one study, Bouchard concentrated on72 sets of twins who had reached adulthood. He first established which of the twins (35 sets in all) were genuinely identical by genetic testing.

These were then invited to complete personality tests.

Such questionnaires, which are widely used by psychologists, pose questions in the form of statements, to which the respondents have to rate their level of agreement on a scale of one to eight. The following is a small sample of the many statements relating to religion:

· I enjoy reading about my religion.

· My religion is important to me because it answers many questions about the meaning of life.

· It is important to me to spend time in prayer and thought.

· It doesn't matter to me what I believe as long as I am good.

· I pray mainly to gain relief and protection.

· I go to my (church, synagogue, temple) to spend time with my friends.

· Although I am religious, I don't let it affect my daily life.

When Bouchard and his team compared the answers to these and other personality questions, they found strong statistical evidence that identical and non-identical twins tended to answer differently. If one identical twin showed evidence of religious thinking or behaviour, it was much more likely that his or her twin would answer similarly.

Non-identical twins, as might be expected (they are, after all, related), showed some similarities of thinking, but not nearly to the same degree. Crucially, the degree of religiosity was not strongly related to the environment in which the twin was brought up. Even if one identical twin had been brought up in an atheist family and the other in a religious Catholic household, they would still tend to show the same kind of religious feelings, or lack of them.

Work by several other scientists has inclined to confirm Bouchard's findings. One study, conducted by an international team at the Institute of Psychiatry in London under Dr Hans Eysenck, looked at information from twins living in the UK and Australia.

The researchers found that attitudes to Sabbath observance, divine law, church authority and the truth of the Bible showed greater congruity in identical rather than non-identical twins - again supporting the idea of a genetic influence.

Bouchard has consistently found in many of his studies that intrinsic religiosity -which seems to incorporate a notion of spirituality - is much more likely to be inherited. Extrinsic religiosity tends to be a product of a person's environment and direct parental influence. Bouchard also found that tendencies towards fundamentalism were also rather more likely to be inherited.

It is of some interest, too, that, in the populations that Bouchard and his colleagues have studied, women tend to have inherited rather more religious attitudes than men.

· The Story of God by Robert Winston is published by Transworld at £18.99. Winston's new series of the same name will be broadcast on BBC TV, starting in December.