I remember at University doing an archaeology/anthropology course on hunter gatherers past and present. One of the essays I wrote was 'were hunter gatherers egalitarian?' and as I recall the conclusion was that those that were completely nomadic were far more egalitarian than those that were more settled.
This tallies with the understanding that 'patriarchy' or women's oppression - the very idea of women as property starts around the same time humans developed agriculture and started to settle down in one place.
That makes sense - because suddenly they had homes that were 'theirs', they were built to last more than the winter season and they would be staying in them full time not leaving it behind. Having a house suddenly had value. Similarly land, which had been shared between the people who lived in large groups as they foraged for what the earth gave them, was suddenly cultivated and growing crops they wouldn't normally grow. This took effort. The crops could be eaten - therefore the land also held value.
As humans start developing the idea of personal property, they are also faced with questions like - who cultivates the land when I am too old to do so? Who gets all this when I am dead? And the obvious answer is -your children. So the children become a commodity in themselves - an investment in the future. And in order to have control of your own tribe of children to care for you and inherit - you need to control a woman.
Men used their superior strength to control women.
But when you're keeping and adult human being as property, perhaps raping them, perhaps beating them, forcing them to bear your children - possibly killing them in the process - well you have to do some really nimble thinking to allow yourself to not be the bad guy. To keep seeing yourself as a fundamentally decent sort of chap.
So men start spinning tales about how women are basically just bigger children, incapable of looking after themselves - so its OK to enslave them. They tell each other that women are seductresses, that not only will they use their wiles on you, but they will use them on any man - get pregnant with any man - so it becomes OK to keep them in the house and limit their freedoms - because these deviant women will go out of the way to be the downfall of upright men. So it's probably her fault if she's crying as you rape her - because she has led you on. They decide that women's biology means they are better suited to nurturing and therefore are incapable of more in depth thinking - so women don't get to be 'elders' - so they don't get to help create the laws and customs as society advances - so the whole thing goes on and on until -patriarchy.
There is a gap of 6000 years between the beginning of farming and the writing of the Old Testament. The OT only sets in stone what has already been happening for generations and generations. It turns patriarchy into a code of conduct and creates an all knowing, omnipotent God as an authority to appeal to - telling people this way of life must be so. It is how the creator of the universe designed it. And of course the people writing the story make it so it benefits them. The people making this story up are the elders who are all men because of what men have been doing for the past 6000 years. Hence you can own a slave, rape your wife - force her to abort a child if you suspect it is not your own, have more than one wife, keep slave girls as not quite wives etc etc.
Religion is a tool of misogyny and patriarchy. Not the root of it.