At the end of days, the prophet Malachi says, you will be able to tell the righteous from the wicked at a glance: "You shall return and discern between the righteous and the wicked, between one who serves God and one who does not" (Malachi 3:18). The rabbis were fascinated by this — not the judgment itself, but the seeing.
Isaiah adds the interior dimension: "And you shall see and your heart shall rejoice" (Isaiah 66:14). What does the heart see that makes it rejoice? Two things, according to Aggadat Bereshit. First: the good prepared for the righteous, the paradise that no eye has yet seen — "No eye has seen, O God, besides You, what You have prepared for those who wait for Him" (Isaiah 64:3). Second: the judgment of the wicked in Gehinnom, and the relief of not being among them. The righteous will stand at the edge of destruction and understand what they escaped.
This is a theology of vindication, not vengeance. The rabbis were careful with the distinction. The righteous do not rejoice at the suffering of the wicked — they rejoice at the clarity. The confusion of this world — where the wicked prosper and the righteous suffer, where justice seems absent or delayed — resolves at the end of days into something legible. "You shall see and your heart shall rejoice" is the promise that the suffering of the righteous was not random, not wasted, not unnoticed. It was always in the accounting.