Archeologist date the origin of the Homo sapiens around 160,000 years ago using carbon dating. Fossilized remains of early Homo Sapiens were discovered in Ethiopia in 1997 by Tim White. Now imagine for a second that you were born in that era. The world must have looked like such a mysterious place. This was the time of many firsts and this is when man first thought about God - or Gods in this case.
Man could not begin to comprehend the world and space around them. Naturally it makes sense that they began to believe in powerful beings that controlled their existence. Imagine seeing a volcano erupt, feel the wrath of an earthquake, or the sound of thunder. Wouldn't you believe in a higher power? Imaginary Gods was the easiest way to explain the unexplainable.
Polytheism is the belief in more than one God and early cultures adopted different polytheistic religions. Arguably the oldest form of a polytheistic religion that is still around is Hinduism, it has been around for thousands of years and it dates back to 3000 BC.
Although their surrounding world led them to believe in many Gods, death was, and still is, the most hardest concept to explain. Life after death is what all religions promise to explain, but how can you explain something that cannot be explained? The answer is: you can't. No one can prove what will happen after death. You can only believe in what happens. Just because you believe something doesn't make it true.
But why would man invent Gods? I think that one can argue that the answer is simply power. That could have been the most powerful motivator for early man to make up such wild stories. When you hold all the answers you have the power. Soon you have everyone believing in the Gods you preach and later they build temples and follow your command. Government wasn't yet established during this time, but religious elders held the power over these first civilizations. Over time the Gods changed names and new stories emerged. Ever since the first people began to believe in a God, religion has played a big part in shaping the course of human history.