Addressing the question of the origins of the god myth, Atheist Republic contributor Dean Van Drasek, finds the answer is simple: a dream, a lie, and an explanation.
You may have come across this topic in books and articles about religion, psychology, anthropology, philosophy, comparative mythology/religion, archeology, and even popular science books. Sadly, there is no answer, as it's buried in the depths of time before humans developed writing, and probably even before there was cave painting. I am not an expert in any of these fields, but I do have some ideas that I find more persuasive than others. Nothing here is original, and it's been picked from a wide variety of sources.
Intelligence in apes seems to be linked to brain size, at least when cross-referenced with technological accomplishments. Hominid's brains in the genus homo developed slowly until about 200,000 years ago. This marked the arrival of our species of hominid, homo sapiens. I suspect that the belief in the supernatural may have been as early as this.
Every human society ever discovered has had some belief in the supernatural. So where does this come from? The answer I find most persuasive is because we, like other animals, dream, but we had the intelligence to question what was the source for this experience.
The origin of gods lies in the belief in spirits, which is the belief that the experience of the mind in dreams was an externally originated experience. Many early cultures (which we know about through their written records) did not know that human thoughts were derived internally from the brain. By the time writing evolved, it was a well-established concept that dreams were frequently thought of as messages from the gods or another outside sources.
All other human sensory perceptions, such as sight, sound, taste and touch, come from external stimulants. When we are awake and thinking, we do not experience purely mental sensory events. Waking memory and dreams use different parts of the brain, which is why dreams can seem so real compared to mere memory. Dreams often use the same parts of the brain which are responsible for the processing of normal sensory signals, such as sight. This, the neurological experience is nearly the same.
In our dreams, which can be fearsomely realistic, we often see our dead family and friends. This presented our ancestors with a logical conundrum, as they "knew" their loved ones are dead, but they could see and hear and may even touch them in their dreams. So without other references, if we see what is real, and in our sleep we "see" those who are dead, then there must be something present that we can't see during the daytime. So an assumption that nocturnal senses would also be stimulated by external forces would be logical.
What happened next was pure human ingenuity. People were seeing these images in dreams, and could not always understand them. At some point in human history, some human decided to lie and claim that they could understand those nocturnal communications. They could interpret the cryptic messages from the dead friends or relatives, or they might even be able to communicate with them or channel them. The first conman was born, who no longer had to hunt or be productive for a living, but who could use their imagination and get the tribe (who more honestly did not claim to be able to understand or speak to these dream-people) to accord them a high status. Thus, the first shamans evolved within the tribes. It is an intrinsic part of almost every human culture, even our modern popular one (just look at all the movies and TV shows where people talk to ghosts and spirits). When we see someone today supposedly channeling the spirit of the dead, we are seeing a relic of humanity going back perhaps as far as 150,000 years or more.
But how to get from spirits of the dead to gods? I like the idea that is based on a basic human weakness that exists still today. People in authority don't like to admit ignorance, because they are afraid this will weaken the regard that others have for them. It would be natural for the tribe to ask the shaman questions such as: Where does the lightning come from? Why does the wind blow? How can I save my sick child? The shaman had no way to answer these questions, but they didn't want to admit this, so they made up an answer based on what people already believed and they knew worked for them within the community: namely, that these other occurrences were also the result of the actions or omissions of spirits, same as in the dreams, but stronger ones. As the lies multiplied and were retold over time, these spirits often became gods. Early recorded religions had thousands of such spirit gods, in the tress, rocks, waters, clouds, animals, etc.
As the explanations got more complex, and writing allowed the stories of the shamans and their ritualistic prescriptions to be recorded, the gods became more complex, rituals more refined, and the priesthood more powerful and organized. Out of this probably arose the institution of monarchy, where a secular ruler was in part entitled to the obedience of the people due to the favor of the imaginary gods. At some point, leadership became hereditary, which is not something we see in most other ape species, where any male can contend for the top spot. But at some point in human history, we decided that a person was entitled to rule over others not because of their own capabilities and merit, but because of their lineage - probably one of the worst ideas in all of human history. At that point, the shaman and the ruling class recognized that they had the same interest in promoting the religion of the gods which kept both in power and affluence.
So why do we have gods? Because we dream, and some people are very imaginative liars, and as we all know, any lie told often enough and loud enough tends to be accepted by many people as the truth.
Why do you think god was invented?