No one knows. But all tribes everywhere dealt with death, floods, crops failing, lightening, thunder, hail, earthquakes. And every single one of those tribes did not know what caused those things.
Thus, they were attributed to spirits, ghosts, or gods. And the "smart" ones of the tribes pronounced themselves shaman or witch doctors, and made up spells and read the intestines of goats or sheep to foretell the future.
Entire families pronounced themselves "royal"...ancient Egypt is a good example of this.... the Pharaoh was the Sun God on the earth, and he got credit for the yearly flood, and the harvest.... and as well, the blame when things went all wrong.
We DO know that they thought something.... Neanderthals buried babies and others who had died, with flowers and amulets. And yet today, there are primitive tribes that have no religion... one is near the Lake Manyara Game Reserve in Tanzania. An article about them a few months ago in Nat Geo Mag. They believe in nothing...dead is dead, and there is no ceremony when one dies.