Danial Dennett, in his book "Breaking the Spell" does a job on reverse engineering parts of religion. In his book he makes the point that there is no physical evidence for a god, but there is a preponderance of evidence for a "belief in a god." This is like the SantaClaus of childhood. the mythical unicorn. Well, perhaps, less people believe in unicorns, but the existence and belief of those who belief is the same thing as with a god that there is no physical evidence of existing.
It is the belief in the concept of a god, without realizing that it is just the belief of a concept of an imaginary thing that is offering the comfort. It is the certainty of though, the community of like believers, and the constant reinforcement that provides the confidence necessary for a peaceful life without knowing the truth; there is no god, only belief in a concept of god. This is the confidence trick of religion.
And that is where I leave Dan... and go on my own. The Buddha claimed that delusions were the cause of suffering. I think this is not quite right, and it should be the belief of the delusion is the root of the suffering, or is that what was said and lost in translation.
I have come to understand religion as just a confidence trick. I feel sorry for those who do not see through the trick, and are so deluded by the illusions into believing. Saving of a non-existing eternal soul or life after death, well... these to are imaginary. Forgiveness for imaginary sins against the religion is just fine, but what about abuse or crimes against humanity? Lying, misleading... these are serious events of life... going half way through life, believing false stuff... wasting lives keeping this religious hocus pocus alive. Religion is the greatest conspiracy ever perpetrated on mankind. It was a system of thinking that got us through the stone age, iron age, but we are now into the information age, and it is time to learn truths, not fiction.
We need a great sorting and purging of wrong information. Only the science can do this. Know truths, recongnise myths as myths, and abandon fiction as fiction. Fiction can also be entertainment, but how much entertainment should the human have? How much of religion was just entertainment? Or is all of religion just entertainment and fill a social need? Are the entertainment and social need enough redeeming value to make some religion useful or at least benign? Once we know there is no god, and only belief in belief of a god, can religion still function? Only for those so inclined.