Moses has died and God's new leader - Joshua - brings His people into 'The Promised Land'. The infant Israelite nation strays once Joshua is dead - and God lets them experience His discipline. The people return to God for a while under the judge God empowers to save them, but when the judge dies - the people rebel again. They will not serve God as King - but cry out for a human king. God knew they would - and is preparing the nation's second king. The line of king David is introduced in the Book of Ruth. Almost one third of the Bible involves king David in one way or another. King Jesus is even called the son of David.
Joshua, Judges, and Ruth set the stage for this pivotal character.