Infants experience their caregivers as gods: gigantic beings with absolute power over the child's world. Adults can make things disappear, reappear, provide sustenance, love, comfort, rest, entertainment, education, guidance. The child depends wholly on the caregivers for protection, nourishment and survival. An infant cries when it wants something from its adults.
The child doesn't have a conceptual framework to call its crying "prayer" or its caregivers "gods". As it grows and learns these terms, it may be encouraged to migrate those feelings of dependency to an even larger being, with all the magical powers it once attributed to its adults.
I was a kid who retained some of those feelings, putting assorted interpretations on them, until my neuron pruning was finished some time in my twenties. I think I'm pretty average in this. Maybe some children, like @dimllaishebiaith, lose that sense as soon as they realise their parents are just people. Maybe some never do.
Research on a 'god spot' or 'spirituality centres' in the brain has yielded nothing conclusive. It might yet turn out that there is some neural configuration associated with being more, or less, inclined to spiritual beliefs: all brains work differently!