It's all about energy. The problem is that early societies were less organized and efficient. If you didn't have a farm or cattle (which both took up a lot of land) then you had to work for someone who did. This basically created the indentured "slave" society. But then it was mutually beneficial since those workers couldn't survive without land.
So in a society where survival is about land, eventually people organize to the point where landowners group up to defend their land against other grouped up landowners. And this simply evolves into kings and kingdoms. But at the end of the day its still about resources and energy that we all use as fuel.
But because landowners had too much power this led to abuse. So naturally, gods come in as a means of establishing divine order and law above that of the king. And kings had to comply, otherwise they risked revolts and revolutions that would remove them from power. It's not like they could simply order their people to fight themselves. But if they people believed in God and God had "ordained" that king then he was all set. Their belief in God would keep them subject to his rule as long as he didn't cross the line too many times.
So all of this is really just humans trying to adapt to their environment and simultaneously explain why their lives were so difficult. Genesis blames it all on women which then created justification for men to treat women as property. But in a society that was about hunting and gathering, physical strength and endurance was more advantageous but women were also men's weakness.
The biblical God was okay with all of this because men were okay with all of this. He was just their explanation/justification for why they had to do what they believed they had to do to survive. So instead of God providing them food during a famine, they would say that God provided a warning that led them to Egypt where they could survive the famine. However... that also came with unintended consequences and why should Egypt share its food with so many outsiders coming into their nation and reproducing like rabbits during a famine? Is that really the right time to explode your population? And if they were an individual who had to find someone else who had land in order to survive, as I described earlier, why shouldn't they have to work? The bible says they were given the land of Goshen. But was that truly just a tax free gift? Or was that simply where they were allowed to live, but still considered part of Egypt. Because if that was Egypt then it would follow that they would have to pay taxes and in exchange for the food Egypt had already taken over land from its own Egyptian owners so how would Goshen be any different?
And even after leaving Egypt (stealing from them as they left), instead of God creating a paradise in the desert, they insist God did all these miracles defying nature but cannot create fertile land in the desert and instead forces them to fight the Canaanites. This whole planet is supposedly the creation of God, and yet, this same environment influences us to kill each other just to survive the same way that too often gangs in the hood fight over street corners to sell drugs. And we tell our government that if they had education and economic opportunities (economic justice) they wouldn't have to resort to criminal behavior in order to survive.
So it's kind of like... if God exists... and he's responsible for our environment, then isn't he encouraging all of these "sins" that are encouraged by people trying to survive and lacking resources? And after fighting over resources and trying to survive we, at the same time, choose different religions, that claim to serve the exact same God, and this exact same God, allows those religions to fight each other for supremacy. All so that we can cry to him about all the sin that is done and all the poor and hungry and homeless and lack of world peace and security, all because the planet he designed is less than hospitable to us and when he never showed us how to utilize the land in more efficient ways or make faster growing fruits and veggies where we wouldn't have to fight. It's kind of like if a city engineer designs a highway that has a bridge that just drops off into a river. Do we just blame ourselves? Or is the engineer at fault too?