He is moved to pity because of their groaning. The text does not mention repentance anywhere, and so the Lord's compassion is pure grace.
Furthermore, his grace is persistent. Whenever…judges…
is the terminology used, indicating that there were many judges raised up. His grace outlived disappointment and betrayal, and it saved them again and again.
18 Whenever the LORD raised up judges for them, the LORD was with the judge, and he saved them from the hand of their enemies all the days of the judge. For the LORD was moved to pity by their groaning because of those who afflicted and oppressed them.