From your link;
Why did we inherit this tendency? Long, long ago, in a Paleolithic environment far, far away from the modern world, humans evolved to find meaningful causal patterns in nature to make sense of the world, and infuse many of those patterns with intentional agency, some of which became animistic spirits and powerful gods. I call these two processes patternicity (the tendency to find meaningful patterns in both meaningful and meaningless data) and agenticity (the tendency to infuse patterns with meaning, intention and agency).
Imagine that you are a hominid on the planes of Africa and you hear a rustle in the grass. Is it a dangerous predator or just the wind? If you assume the rustle in the grass is a dangerous predator and it is just the wind, you have made a Type I error (a false positive), but to no harm. But if you believe the rustle is just the wind when it is a dangerous predator, you have made a Type II error (a false negative) and there's a good chance you'll be lunch and thereby removed from your species' gene pool. Because we are poor at discriminating between false positives and false negatives, and because the cost of making a Type I error is much lower than making a Type II error, there was a natural selection for those hominids who tended to believe that all patterns are real and potentially dangerous. This is the basis for the belief not only in God, but in souls, spirits, ghosts, demons, angels, intelligent designers and all manner of invisible agents intending to harm us or help us.
There was an evolutionary benefit to believing in religion when we were in danger of being eaten by wild animals.
Some of us have evolved beyond that point.