Divine justice is fundamentally rooted in compassion. When people face hardship or periods of distance from God, it is natural to fear that His frustration will last forever. The primary approach among commentators is that even when the Israelites find themselves in distress or exile, their situation is never permanent. There remains a constant hope that God will eventually return and show mercy. His anger is strictly limited in time, designed ultimately to bring about healing and repair rather than endless suffering.
Divine frustration manifests in two distinct ways: active punishment through an open struggle against those who do wrong, and a more internal, lingering anger where sins are kept in mind over a long period [מצודת ציון, מלבי״ם, ביאור שטיינזלץ]. Yet, God does not maintain this punishment endlessly [מאירי, מצודת דוד]. This is especially true for those who sincerely repent and return to Him, though He may continue to hold resentment against His absolute enemies [אבן עזרא].
A deeper perspective views the experience of punishment in this life as an act of profound divine kindness. This approach draws a distinction between our temporary, physical reality and the eternal nature of the soul in the world to come [מלבי״ם]. God does not simply overlook strict justice or ignore human failings. Instead, He actively chooses to discipline people in this current world to cleanse them of their wrongs. By doing so, He spares them from the far greater shame and intense suffering of hell in the afterlife. God acts quickly to address and punish sins here so that He does not have to hold onto them. This guarantees that He will not remain in conflict with the human soul in the eternal, higher world [אלשיך, מלבי״ם].