It has some accurate historical facts. It has some true statements which betray some knowledge of popular empirical psychology. The rest are legends and myths. I think it's the opera of some smart Jew compilers...any nation needs an ethno-genesis story in order to found it's claim as a people over a piece of territory. Some of the story is true, some is fictional. All nations have a legend that tells a story about how they came into being and about how their ancestors lived in their lands. The OT is an ethno-genetic myth of the Jewish people. Some is true, some is fictional.
The fact is their ancestors came and conquered the territory of the ancient Israel from the native populace, which were mostly exterminated, and settled there. The OT says YHWH, the Creator, gave them those lands and the right to conquer and obliterate the native inhabitants. History is written by the victors.