Following the death of Joshua and during the period of time that the elders who outlived him were alive, the people had continued to serve God.
“Then the children of Israel did evil in the sight of the Lord…” They forsook God and began to follow the various idols of Canaan. Even though it had been forbidden, they intermarried with the sons and daughters of the heathen nations.
As the Israelites turned their backs against God, He turned His back against them and allowed them to be delivered into the hands of their enemies. When they would cry out in penitence, He would mercifully receive them back. In order to have orderly direction, God began to choose judges to lead them. They were usually military leaders and administrators.