Robin Dunbar’s explanation (Dunbar, 2006) provides what is probably the most convincing explanation of religion. It is based around theory of mind (the ability to anticipate the thoughts of others) and orders of intentionality (what X might be thinking about Y’s thoughts regarding Z).
Story-telling, science and religion all require 5th order intentionality – eg, when writing Othello, Shakespeare required five orders: he intended (1) his audience his audience to understand (2) that Iago wants (3) Othello to believe (4) that Desdemona intends (5) to run away with Cassio. Probably, though, story-telling was a spinoff – from the ability to, as we would now put it, to “do science”. High-order intentionality is crucial to understanding the natural world – science – which would have been crucial to the survival of early modern humans as the left Africa and attempted to colonize novel environments. To understand seasonal migration patterns of herd animals, the correlation between moon phases, tides and fishing, etc and to share this knowledge with others, would have required equally high orders of intentionality.
The ability to tell engaging stories round the campfire would have been a useful spinoff, good for group morale; serving the same purpose as literature – and indeed cinema and theatre today. But there was another spinoff – religion.
Theory of mind is crucial to religion. To engage in religious activities, I must believe in a parallel world inhabited by beings whose intentions can be influenced by my prayers. These beings must be able to understand what I want – requiring third-order intentionality: I believe (1) in gods that can be persuaded to understand (2) what I desire (3) and will act on my behalf. In fact, more than three orders of intentionality are required in any practical religion because religion is a social activity; a shared belief system and people must share their faith with others in a community.
In his book The God Delusion, Richard Dawkins argues that religion is a “misfiring by-product” of something else (Dawkins, 2006), though in early hunter-gatherer societies, religion would have been a powerful group bonding mechanism and not as entirely malign as Dawkins supposes. Only much later, when humans began living in far more complex societies, was religion used as a means of control by the ruling elite.
However, it is possible that it was responsible for social division as far back as the Upper Palaeolithic, manifesting itself in the cave art of that time. David Lewis-Williams has suggested that art and ritual, while contributing to social cohesion, did so by marking off groups from other groups, thus creating the potential for social tensions (Lewis-Williams, 2002); a trend which has unfortunately continued to the present day. It is probably no coincidence that some of the finest art and architecture ever produced has been religious in nature and if Lewis-Williams is right, the origins of this creativity are very ancient indeed.