History of when the OT was written
In the West barely two centuries ago anyone saying the first five books of the bible were not written by Moses was most likely to be run out of town. A few centuries before that the stake for heresy was in their future. Today only the most backward believers hold that silly belief in Moses as author.
If you do not like silly substitute illiterate, uneducated, and superstitious. Use any term that does not sympathize with or encourage them. You can respect someone else's beliefs on your own time. This is a discussion of facts where belief in Moses actually existing is no different from creationism or a flat earth.
Why not Moses? How did he write in a language that did not yet exist about things which had not yet occurred and gotten everything wrong about ancient history? And if he did, he was certainly not inspired and was just a fruitcake. And in terms of most all the world as all times, if the moral system was revealed by some god then that god is indistinguishable from a demon.
But enough of that. There came a time almost a century ago when the least silly believers had to admit Moses did not write those books as religious tradition held and still holds. They began a retreat that continues to this day.
The first but short-lived retreat was to the time of judges where it was imagined the people consolidated their history by writing it down. The same reasons that caused the rational rejection of Moses as author applied to this also including the absence of evidence of a literate culture. This absence was to plague all future retreats.
The next retreat was to the time of King Solomon. After all was not a great kingdom the right place to write down the history of the people? Of course the absence of a literate culture struck down this idea as well as the realization that Solomon and biblical Israel were also myths along with Moses and the captivity in Egypt.
At present the least silly believers have decided, again with no evidence whatsoever, that the books of the Old Testament were written after the return from captivity in Babylon. But again the same facts intrude. There is no evidence of a literate culture. The captivity is a myth so there was nothing to return from. All the argumentation as to reasonableness collapses for the total absence of physical evidence.
So here was have a retreat of nearly 1000 years all from the nonsense of the claims and still existing solely by ignoring the fact that the return from Babylon time of writing the books of the Old Testament suffers from all the same faults as the previous retreats.
One can find other, more complicated suggestions as to the origin of the stories dating things from different ages and periods. It is all scholarly bullshit. I mean I am willing to consider any who and when creation idea if and only if it is presented by comparison to other texts from the same time period. There are no other texts. There is nothing to compare them to. Because there is nothing for comparison it is all nothing but scholarly bullshit.
And that raises the larger problem because there is nothing for comparison there was no literate culture to have created anything including the bible books themselves.
The transparent rationalization around this is that the stories were so important that they were the only things committed to writing. That is contrary to all archaeology in all cultures. But then the question is who were they written for?
The usual rationalization is there was some need for consolidating the people. They never get around to explaining how this would work for an illiterate populace. There were two reasons for writing things down. Monumental inscriptions and/or to impress other kings and nobility. There was certainly no purpose to show it to an illiterate populace.
No, the Judean population was not literate. But what about the Bar Mitzvah? Jesus in the temple? Late breaking news. The Bar Mitzvah was invented in the late 19th century based upon the story of Jesus in the temple. Consider it the only Christian sacrament in Judaism. For the record, even if Jesus is not a myth that story is incredible.
The Old Testament, the root of all evil
Because its hundreds of rituals and taboos were to establish a society where the Maccabes as priests had the power of life and death over everyone. As the Christians wrote explicitly, everyone is a sinner. God punishes sinners both after death in case the priests miss someone. Also Maccabeanism gave the priests of its Yahweh cult the authority send sinners to Yahweh for immediate punishment.
Normal religions are not like that invented by the Maccabes. They may be strict in some matters. They may have odd rituals and taboos. They are also invented by the people who have to live by the rituals and taboos.
Maccabeanism is a totalitarian political system not a religion.