Judges 2:17-23

17 But the Israelites paid no attention to their leaders. Israel was unfaithful to the Lord and worshiped other gods. Their fathers had obeyed the Lord's commands, but this new generation soon stopped doing so.
18 Whenever the Lord gave Israel a leader, the Lord would help that leader and would save the people from their enemies as long as that leader lived. The Lord would have mercy on them because they groaned under their suffering and oppression.
19 But when the leader died, the people would return to the old ways and behave worse than the previous generation. They would serve and worship other gods, and stubbornly continue their own evil ways.
20 Then the Lord would become furious with Israel and say, "This nation has broken the covenant that I commanded their ancestors to keep. Because they have not obeyed me,
21 I will no longer drive out any of the nations that were still in the land when Joshua died.
22 I will use them to find out whether or not these Israelites will follow my ways, as their ancestors did."
23 So the Lord allowed these nations to remain in the land; he did not give Joshua victory over them, nor did he drive them out soon after Joshua's death.
Scripture taken from the Good News Translation - Second Edition, Copyright 1992 by American Bible Society. Used by Permission.