In the divine system of justice, destructive forces meant to harm the world often change course, ultimately falling upon those who create them and acting as a protective shield for the good. The primary approach among commentators is that a direct exchange takes place during times of hardship. When trouble descends, the righteous person is rescued, and the wicked becomes trapped in their place, much like the historical events involving Mordecai and Haman [רש״י]. This substitution is rooted in the demands of strict justice. When a harsh decree is issued, the heavenly court requires a payment to satisfy the judgment. In His providence, God arranges events so that the wicked serves as a ransom for the righteous, absorbing the intended blow [רלב״ג, מצודת דוד, עמנואל הרומי]. In this way, the evildoer essentially functions as a sin or guilt offering, absorbing the disaster to clear the debt of the innocent [אלשיך].
While some commentators view this dynamic as a single, repeated concept [מצודת דוד], others find a deeper distinction between different levels of goodness. A righteous person might only be innocent in a relative sense, appearing favorable only when compared to the wicked. Therefore, the evildoer serves as a general ransom to appease the demands of justice on their behalf. In contrast, upright individuals possess true inner moral and intellectual perfection. Because they exist on a much higher spiritual level and are closer to God, they do not require a ransom at all. Instead, when a treacherous person plots to harm them, the attacker falls exactly into the trap they set, suffering a direct, measure-for-measure consequence for their own scheme [מלבי״ם, אלשיך].
Alongside the idea of heavenly providence and the shifting of decrees, an educational perspective offers a different understanding. In this view, the rescue is not a physical exchange of fates but rather a profound learning opportunity. The visible punishment of the wicked serves as a clear warning sign. Witnessing this downfall is exactly what causes good people to pull back, guard themselves against wrongdoing, and ultimately be saved from sin [אמרי דעת].