Now, on a completely unrelated note, there are various potential explanations that have been suggested for the fact that religious belief is very common - generally either taking the form that it in some sense carries a social benefit, or that it is a side effect of something else (or an interaction of several somethings) that carry a benefit. Some of these explanations have some evidence for them, though I don't think there's really conclusive evidence that any of them forms a complete explanation.
Anyway, something Dana said brought up a thought:
She doesn't ever state this directly, but the end of the movie talks about her daughter reaching for magical explanations when Julia's trying to explain things like death in rational, material terms. And that struck me: religion is never growing up. What her daughter invented to make herself feel better about things she didn't understand sounded exactly like the answers most human religions invent.
We as a species have never seemed to mature past the age of four.
And then I thought... if you add in the "invisible friends" bit, you've got a couple of indicators of development typical of maybe a three year old.
That reminded me of neoteny - the retention of juvenile characteristics into adulthood. This is a common evolutionary trick - rather than change an underlying gene, alter the timing of its development - it's generally going to be a much smaller change (this sort of idea should be standard fare for the evo-devo crowd, but I first encountered the concept in one of Dawkins' books, many years ago), but the effects can be dramatic.
Humans are "masters" of neoteny. We retain dozens of juvenile-ape characterstics. It's why our faces tend to be almost hairless. It's why we play games and retain curiosity into adulthood. It is one of the major drivers of our success; it is, not to put too fine a point on it, a prime cause of why we are who we are: I gather chimp brain development continues until about 1 year of age. In humans it lasts until we're about 23!
Is it so surprising then, that certain mental development characteristics of toddlers might hang on? If our evolution has caused us to so dramatically retain certain juvenile aspects of brain development, might associated mental milestones tend to come along with them?
Is religious belief a side effect of neoteny?
If speculation is not to your taste, have some (tangentially related) science - on genes in humans that have shown a much higher rate of evolution since our last common ancestor with chimps - what potentially makes us what we are.