The Mekhilta DeRabbi Yishmael cites a verse from (I Samuel 24:19) that contains one of the most intriguing phrases in all of Scripture: "As stated in the apothegm of the Primal One: 'From the evil shall evil go forth.'" This ancient proverb, attributed to the "Primal One" or the "Ancient One," encapsulates a principle of divine justice that the rabbis found embedded in the Torah's own laws.
The context in Samuel is David's encounter with King Saul in the cave at Ein Gedi. David had the opportunity to kill Saul but refused, cutting only the corner of his robe. When David revealed what he had done, Saul acknowledged David's righteousness and quoted this ancient proverb: from the evil, evil shall go forth. The wicked will be punished by their own wickedness. The righteous need not lift a hand.
The Mekhilta then asks: where in the Torah is this principle stated? The answer comes from the laws of manslaughter: "And if he did not lie in wait for him, but God put him into his hand" (Exodus 21:13). This verse describes a case where one person accidentally kills another. The rabbis interpreted it to mean that God arranges circumstances so that justice is accomplished through seemingly accidental events.
The Talmud (Makkot 10b) elaborates this idea with a famous parable: two men, one a murderer and one an accidental killer, both previously unjudged, arrive at the same inn. God arranges it so that the murderer sits beneath a ladder and the accidental killer descends, falls on him, and kills him. The murderer receives his death. The accidental killer receives his exile. Justice is done without any human court. From the evil, evil goes forth, exactly as the proverb of the Primal One declared.