Book of Judges
In the book, there is a pattern which repeats.  The people turn from God, and he allows their enemies to harm them.  Then they pray to God.  He sends them a new judge.  This judge helps the people and defeats their enemies.  The people are happy for a time, but soon they again turn from God.  The cycle repeats itself.