After Moses died Joshua led the people of Israel for many years, but when Joshua died there was no longer one foundational leader to lead Israel back to God when they strayed, so God raised up the Judges. The Judges were men and women God used to move His plan of salvation forward and to save Israel at the same time.
The regular pattern throughout the book of Judges is that Israel is unfaithful to God, God sends one nation or another to punish Israel and bring them back to Him, Israel then repents and calls to God for help, and finally God sends a Judge to save them. Wash, rinse, repeat.
We see in Judges that God takes sin seriously but that He takes true repentance just as seriously. God’s punishments are meant to bring us back to Him and His forgiveness.