The history of Israel was recorded by the priests and maintained in the Temple.
It is a picture seen through their eyes, and given a positive spiritual twist.
If they, the people of God, are triumphant, then God is pleased with them.
If they are defeated or fail, God is angry. They have sinned.
It is a simplistic code, which depends largely
on the integrity of those who set the rules
that have to be obeyed to win God's favour.

These started as straightforward rules for an itinerant desert people,
(We now call those basic rules "The Ten Commandments")
but changes were needed to adapt them for a settled powerful kingdom.
Much thought and ink went into revising and detailing the changes.
That is largely the theme of the books Deuteronomy and Leviticus.

The Bible continues with a record of invasion and conquest,
followed by the allocation of the land amongst the tribal families.
Such decisions were said to be divine, so precluding any human dissent!

In "Judges" the killing and barbarity continues under divine direction,
until loss of unity and centralised authority brought defeat
and curbed the conquest of new territory.
Comparitive stability allowed Israel to intermarry with local tribes.
Even so there were constant struggles and raids.
Israel survived in a sea of hostility.

After Israel had become established in the land, civil war soon followed .
The house of the upstart David fought against that of the ruling clan,
and eventually conquered, often through treachery and deceit.
Even so he established a strong and effective rule,
favouring the priesthood and giving them power.
Thus the good reports of his reign!

Thereafter the tale is of a quarreling contentious people
fighting amongst itself and with its neighbours;
of political intrigue and loss of influence.

Prophets warned of the consequences of turning away from God
but were ignored or executed by the temporal power.
The diminshing role of Israel in the world was,
predictably, blamed on abandonning their God
turning away from his Laws and covenant,
and the rule of priest and Temple.