God and Agency in the Mind:
An interesting article from 2009 on why religion may be a by-product of the way our brain attributes agency to objects and persons, starting very early in childhood:
So how does the brain conjure up gods? One of the key factors, says Bloom, is the fact that our brains have separate cognitive systems for dealing with living things - things with minds, or at least volition - and inanimate objects.
This separation happens very early in life. Bloom and colleagues have shown that babies as young as five months make a distinction between inanimate objects and people. Shown a box moving in a stop-start way, babies show surprise. But a person moving in the same way elicits no surprise. To babies, objects ought to obey the laws of physics and move in a predictable way. People, on the other hand, have their own intentions and goals, and move however they choose.
Bloom says the two systems are autonomous, leaving us with two viewpoints on the world: one that deals with minds, and one that handles physical aspects of the world. He calls this innate assumption that mind and matter are distinct "common-sense dualism". The body is for physical processes, like eating and moving, while the mind carries our consciousness in a separate - and separable - package. "We very naturally accept you can leave your body in a dream, or in astral projection or some sort of magic," Bloom says. "These are universal views."
There is plenty of evidence that thinking about disembodied minds comes naturally. People readily form relationships with non-existent others: roughly half of all 4-year-olds have had an imaginary friend, and adults often form and maintain relationships with dead relatives, fictional characters and fantasy partners. As Barrett points out, this is an evolutionarily useful skill. Without it we would be unable to maintain large social hierarchies and alliances or anticipate what an unseen enemy might be planning. "Requiring a body around to think about its mind would be a great liability," he says.
This leads to beliefs that the world is constructed "for" agents with minds:
Again, experiments on young children reveal this default state of the mind. Children as young as three readily attribute design and purpose to inanimate objects. When Deborah Kelemen of the University of Arizona in Tucson asked 7 and 8-year-old children questions about inanimate objects and animals, she found that most believed they were created for a specific purpose. Pointy rocks are there for animals to scratch themselves on. Birds exist "to make nice music", while rivers exist so boats have something to float on. "It was extraordinary to hear children saying that things like mountains and clouds were 'for' a purpose and appearing highly resistant to any counter-suggestion," says Kelemen.