Sunday's Bible story took place chronologically after the death of Joshua.
The Israelites had God’s laws to help them live their everyday lives, but without a leader they fell into a cycle of sin. They turned away from God and worshiped idols, which led to bondage and oppression by foreign kings. Then they remembered God and cried out to Him. God raised up a judge to deliver them, and finally there was ease in the land. The Israelites needed someone better than a judge; they needed a king who would save them not only from the consequences of their sin, but the sin itself.
That was all part of God’s plan. God sent a true Deliverer; His Son, Jesus, died for our sin and delivered us forever from the oppression of sin and death.