The Israelites took the situation that they were in and surrendered it to God, trusting that He would work through the circumstances that they were in.
As the people experienced the renewal of their relationship with God, they made a decision to renew their commitment to be faithfully obedient to that relationship as well.