Shimei stands before King Solomon to receive his final sentence. After Shimei remains silent in the face of the accusations against him, the king reveals the true root of his impending punishment [אברבנאל]. Shimei is officially being condemned for leaving Jerusalem, breaking a strict royal command. Why, then, does Solomon bring up Shimei's past offenses against King David?
The primary approach among commentators is that Solomon is not punishing Shimei directly for that past treason. Instead, he is explaining the spiritual cause behind Shimei's current foolishness. It is the weight of his old sin against David that caused him to stumble and break his recent oath. On the other hand, an alternative perspective suggests Solomon brings up the past to justify the execution to the public [רלב״ג]. If the people only saw Shimei executed for leaving the city, they might view the punishment as too harsh for a minor offense. Solomon clarifies that Shimei truly deserves death for cursing King David, and the broken travel restriction merely provides the legal grounds to finally collect the debt for those past actions.
Solomon addresses the condemned man by referencing the evil that Shimei knows in his own heart. By speaking this way, the king deliberately avoids repeating the shameful curses Shimei once hurled at David, choosing instead to hint at the guilt the man already carries [מצודת דוד]. Furthermore, pointing to the heart reveals that Shimei's private, malicious thoughts toward David were actually far worse than the words he spoke aloud [רד״ק]. This inner awareness also proves that his past actions were not accidental or spoken out of a mistaken lapse in judgment, but were entirely deliberate and wicked [מלבי״ם].
Finally, Solomon declares that God is bringing Shimei's wickedness back upon his own head. Commentators agree that this highlights a profound display of divine providence and the closing of a moral circle. Even though King David previously swore an oath not to kill Shimei, God did not overlook the crime. It was divine providence that guided the course of events, causing Shimei to act foolishly and violate both his oath to God and the command of King Solomon. This orchestrated failure created the legal justification for his execution, delivering his true and final punishment from God for his original sins.