It was never written, it was compiled. There’s like double the amount of books but the church cherry picked the books they wanted to include and ignored the ones that went against their world view. I’m the end it was put together for power and control. Even the fact that most people weren’t even allowed to read it, meant that all the “laws of god” were being filtered to you through the church and whatever it was they wanted at the time.
To record their version of “truth.” There was no distinction between fact and fiction, they were written to establish the “official” history with the political and religious (again, no distinction) agenda they wanted people to follow. The idea that history should involve accurate facts of what actually happened is a relatively new phenomenon in human culture.
Did the people of the time understand that nuance? I honestly don’t know. I assume most of the uneducated masses didn’t, which is why the elites wrote that way.
If you look at the dietary laws, the injunctions to monotheism, and the laws concerning sexuality and marriage it suggests that the prime concern was with providing the numbers to outcompete other nations, and I am using the word in its original meaning of an alliance of closely related tribes or clans. Israelite Nation, who are the people we have to thank for the Abrahamic religions, could see that it was a pure numbers game. If you could prevent food poisoning and other biological hazards and could also provide an extensive system of laws to adjudicate disputes without the need for violence within the tribes, then you could get everyone faced the same way. You had a growing population so that once the warriors killed the neighbours you could then quickly settle and colonise with the civilian contingent who could then produce more supplies for ever bigger military campaigns.
The many different books of the modern Bible were written hundreds of years apart, had many different versions of the same ‘book’, existed amongst many other ‘books’ that are now apocryphal or just totally lost to history, and were of many different genres, written in different languages.
This is like asking ‘what was the strategic purpose of the entire history of the kingdom of Spain’.