My father-in-law, a very articulate man with a passion for science and learning - but also a devout catholic (oddly) not only threw me the old 'it's a comfort' argument, but being a qualified medic told me about research which discovered that the act of worshiping a deity increases the brain's endorphin level. God really is a drug, just like any chemical stimulant of this 'pleasure area' of the brain. Believing in god, and all the stuff surrounding it, is designed to make you feel good. So I started to think about why the brain does this. Why are humans programmed to believe in an afterlife? What is the genetic benefit? How does it enhance our evolutionary prospects? And therefore most intriguingly, why might belief in an afterlife improve our chances of survival? A question which at first glance seems wildly contradictory. Dying helps living?
Here's my theory. We know that many of our genes program us to behave not as individuals living in isolation, but as social animals. Our ability to survive and propagate our genes within an environment is not just about eating, drinking, shelter and warmth, it's about finding a mate (or more typically for primates, mates - better not get into trouble with the wife here, so I'll leave it at that for the moment) and protecting our offspring. Amazingly our genes care about not only what happens to us as individuals, but to themselves as they exist and move through future generations within our children and their children. The Selfish Gene protects itself at all costs. We protect our children with all our might. We'd even lay down our own lives defending them, and everyone else who will help them and therefore our genes, to survive and continue our personal strains in competition with everyone else's. This would include the versions of our own genes (albeit modified, but somehow close enough) within our wider family and ultimately our tribe and nation state. [An interesting psychology experiment would be to plot 'genetic distance' with 'propensity to defend'. Many a war might be resolved or at least better predicted if we could scientifically measure this aspect of tribal compulsion to fight].
So what helps a 'gene-defender' fight to the best of their ability, and crucially therefore without fear of losing their own life? Someone given extra strength in the belief that they will not really die, fights without fear, and therefore harder. William S puts the whole argument rather well, albeit before Charles D might have given him something else to think about (by turning Glory into an Evolutionary Imperative).