I think it may have begun as an evolutionary-driven bias in humans to assume living beings were the cause of various phenomena that were temporarily or permanently unexplained. The theory goes that a primitive would survive better if they thought that the snap of a nearby twig in the forest was down to an animal or person. With that bias they'd be more able to evade predators.
Similarly, when extreme weather, infection, etc. wreaked havoc, we might have "reasonably" assigned it all to a mighty, invisible living agency, and used the only means at our disposal - attempted appeasement - to avoid annihilation. We had no science to offer the explanations we have today. So we "sacrificed" things to the gods, reassured them that we fully internalised our deference to them.
Also, as a highly cognitive species we can anticipate our own certain deaths, which is a terrifying thought, as is the deaths of our fellow humans, so it's emotionally a great comfort to imagine some kind of afterlife for them and for us. We're in denial because we can't cope with the fact of our complete annihilation. Our prime directive is survival, death is anything but survival.
So I think our ancestors all made religion up, though I don't doubt that our leaders tweaked the superstitions, consciously or unconsciously, to help perpetuate and enhance their control over us. And upbringing is the strongest predictor of religious belief there is. Most people are religious because their caregivers and local community were religious, so you could say our parents made religion up, though they may have believed it themselves so it wasn't necessarily a cynical, deliberate lie.
Yes, theologies got complicated, but for the masses the take-home message is pretty simple - do the deity's bidding as interpreted by the spiritual authorities, don't try to go it alone or think outside of the divine box.