One interesting feature of Joshua's farewell speech in the book of Joshua is its surprising pessimism. He urges the people to remain faithful to the covenant, the people respond positively, but then Joshua dampens the mood with a pessimistic mood that seems overly dour: "You will not be able to serve the Lord . . ." (Josh 24:19). In this way, Joshua's final speech echoes the somber tone of Moses' final speech at the end of the Pentateuch (Deut 27-33).
In this light, Joshua's last words gain interpretive significance. At the end of the Book of Joshua, Joshua himself prepares the readers for what they will encounter in the Book of Judges.
Chris Miller draws out the significance of this element for the period of the Judges:
Just before Joshua died, he warned the people three times to get rid of their foreign gods in order to properly serve Yahweh (Josh 24:14-24). Three times the people responded that they would indeed serve Yahweh, but, conspicuously, they never agreed to give up their idolatry. Their silence in the matter was deafening, and the story of Judges displayed Joshua's insight into the tendencies of his people. Instead of destroying the pagan culture of Canaan, they absorbed it and became just like the nations around them, losing their unique identity as the people of God. . . Ultimately, the problem was Israel's lack of faith and not the power of the opposition.—Chris A. Miller, "Judges," What the Old Testament Authors Really Cared About, 187-88.