While religion might have played a role in our evolutionary development in the distant past, providing a virtual touchstone from which to compose and organise our thoughts, religion is inherently plagued by a lack of basis in reality lending itself to presupposition while maintaining a pernicious grip over ones ability to assess and reframe ones world view in the light of newly acquired knowledge. Religion is at best a primitive form of philosophy built on false premises and opposed to revision.
Lacking a sufficient knowledge base upon which to begin to build a coherent view of reality, our place within it and a basic tool kit enabling them to deal with effects of unknown cause and origin, the world must have appeared a much more frightful, random environment in which to live fostering feelings of helplessness and hopelessness. It's not so hard to imagine how religion might have provided an albeit illusory coping strategy when people first became aware of their inescapable impending death, dreading the unknown with only the imaginations of the worst amongst them to inform them of what might be waiting for them beyond.
I suspect it is an ignorance and dread, in excess of the knowledge of ones eminent and possibly painful demise, of that which might be ones fate beyond the grave, that remains one of religions greatest attractions to this day, another being a distrust of accompanied by an apparent need to rely upon the rationality of others, no less than on ones own, fears that are both instilled and fostered by religion for the sake of acquiring converts and obtaining tribal loyalty.
Whatever false hopes early humans might have leaned on and unfounded beliefs they might have clung to in the past, the reality that has always been and remains is that knowledge and the understanding which can only be acquired through a process of reason is and has always been the source of each and every benefit we have derived beyond that which we acquired by trial and error, natural selection and survival of the fittest which we inherited from and own entirely to the ongoing process of evolution. When all of the trials and tribulations we have endured due to religious beliefs and practices are finally confined to the history books perhaps then the answer to this question will be as startling clear to all as it is already to some . . . if only a few.
But in the interim, there's little point in trying to explain that which some remain afraid to consider, those who, having been encouraged by religion only to dread that which they are afraid of knowing, cling steadfast to their ignorance, much to the detriment of us all.
In short, for learning how best to live ones life there really is nor ever has been a substitute for rational thinking, in spite of anything which poses as an alternative to or for it.