The tendency to ascribe intelligent activity to non-intelligent natural phenomenon is pretty universal, which then leads to the birth of gods in our minds.

This is supposedly a survival mechanism. If the caveman saw the bushes blowing in the breeze, he could assume it is either a bear about to eat him or nothing to worry about. Those that always worried about the bear would survive, even at the cost of running scared from the wind 99% of the time. Those that did'nt worry saved energy but were eventually all eaten.

Which in turn created the ability for us to feel "spooked", when we saw swirling leaves. Now we KNOW is is just the wind, but a piece of us isn't sure. And at that point we go: Hmm - maybe is is my dead ancestor/loved one/enemy/god of wind.

And then gods are born.

Next step is to convince others, and then in a bit you have a religion.

There was a pretty good article on this a couple of weeks ago, which I'm too lazy to google up right now - got to head out the door.