to me all religions are made to maintain a certain level of control over society
I don't think origin happened because of that.
Let's put ourselves in ancient times.
You will see death, natural disasters, phenomenons like sun rise and sun set, winds, rains, seasons, stars.
There would no explanation due to limited knowledge.
There would be fear of few things like disasters, diseases and other things would give relief like warming sun, plants.
There would be some who will wonder why such things happen.
Perhaps this gave rise to animism and worshiping of nature.
As societies became more complex with development of civilization and agriculture, religion became more structured - organizations of rituals, preaching and so on.
It gained influence because religion touch something very powerful psychologically - fear of something bad will happen, sins, hope, identity.
And, with concepts like divine authority, moral rules and considering religious texts as scared, control gradually became more prominent