This is something I don't know much about, although I gather that there are many theories that attempt to contextualise religion within evolutionary processes.
I'm familiar with the animistic bias/error management theory version of religion as a byproduct of the evolutionary benefits of paranoia (I like that one); and I'm aware of the theory that uncertainty has considerable drawbacks, leading people to formulate what one might call 'working hypotheses' ('guiding principles' in Adlerian psychology, or 'fictions' in Vaihinger's philosophy of as if) to deal pragmatically with unknowns.
I have come across other theories, although I've forgotten the details, many of which I wasn't immediately convinced by (which is presumably why I forgot them again); what are the current views on evolutionary advantages of religion, and what do people think of them? I've even forgotten the particulars of Dawkins' version...