President Trump’s regular cries of “Witch Hunt!” — he has tweeted the phrase more than 300 times in his presidency — conjure the image of an irrational mob, whipped into hysteria by cynical political operators to pursue Trump, the unjustly accused victim.

We haven’t seen actual witch hunts in centuries, which is why comparisons to them are effective discrediting devices: They evoke a world in which ignorance, superstition and lawlessness reigned. While Trump is not facing the modern-day equivalent of the witchcraft persecutions that convulsed 16th- and 17th-century Europe, the original witch hunts were driven by perils from which the modern age has by no means escaped: a focus on individual culpability, an unfounded confidence about the sources of social ills and the use of the legal system to produce certainty after the fact. Understanding the witch hunts can help us see how these factors continue to devastate communities today.

The witch hunts grew out of the far more routine phenomenon of witch trials, in which one person or a few people were tried for the crime of witchcraft. These trials started not because people began believing that witches existed (this belief both predated and outlasted the witch trials), but because people decided to blame witches for specific, tangible misfortunes they experienced (such as crop damage or sudden illness) and to use the legal system to hold witches responsible for the harm attributed to them.

Witch trials were legal proceedings, requiring evidence, taking place according to formal rules and resulting in public judgments of innocence or guilt. Numerous legal handbooks and rulings specified the types of problems that witches could cause, detailed proven indications of witchcraft and confirmed that witchcraft required collusion with the devil and, for that reason, was punishable by death.

These certainties were grounded not just in theological deduction but in the confessions of the witches themselves. Typically required before a death sentence could be imposed for a “secret” crime such as witchcraft, confessions were almost always extracted under torture or threat of torture. Legal scholars recognized the potential unreliability of these confessions, and, thus, due process required a level of probable cause before employing torture, limits on the duration and frequency of the torture sessions, and the accused’s confirmation of the confession afterward. Such precautions normally sufficed to keep witch trials confined to the usual suspects: those (usually women) who had a long-standing reputation for witchcraft, sometimes cultivated by the suspected witch herself as a source of social power and income.

If a witch trial aimed to identify and punish a person who had harmed another through magical means, a witch hunt pursued a hidden mass of malevolent conspirators seeking to bring down the entire social and religious order. As the perceived problem was scaled up, so, too, was the response from officials. Several circumstances could trigger this dangerous escalation: a particularly severe catastrophe; a zealous ruler, religious leader or “witchfinder”; or reports of witch hunts in neighboring jurisdictions.

With intense pressure on investigators to track down the agents of the devil wherever they were hiding, the pool of the plausibly accused widened vastly beyond the usual suspects. Normal procedural restraints were swept aside, and torture was applied early, frequently and indiscriminately if a person was named as a witch by two other confessed witches. Accused witches were tortured to reveal the names of additional suspects as part of their confessions, keeping the process going and confirming investigators’ beliefs in widespread diabolical malevolence.

Thus the trial of an ox herd who claimed publicly that he regularly traveled with the “phantoms of the night” led to months of trials and the execution of roughly two dozen people in and around the village of Oberstdorf in Bavaria in 1587. In the small territory of Ellwangen, more than 250 people were put to death in 1611-12, and in the city of Bamberg, the authorities burned more than 400 people over a span of just five years in the 1620s.

Yet the problems attributed to witches — storms, illness to livestock or children, sudden bodily afflictions, milk that would not curdle or thread that kept breaking — persisted despite these mass executions. Doubts had always been raised about whether a particular person was a witch (hence the necessity of a trial), but increasingly the efficacy of witch hunting was being questioned. Witches might exist (and most commentators maintained faith in their existence), but mass executions didn’t seem to stem the devil’s influence. The excesses of the witch hunts could even be seen as the work of the devil.

What shifted, in other words, was not the appraisal of the problem, but the faith attached to the solution.

The early modern European witch craze is typically attributed to ignorance, the product of superstition and fear of the unknown. Yet its lethal power came from the certainties imparted by legal processes; when those crumbled, witch hunting ended.

This has implications for today, but not in the way headlines might make us think. The history of witch hunts actually sheds light on our criminal justice system, and its failures, then and now. We continue to blame marginalized groups for perceived crises, which authorities then proclaim to have solved through mass punishment of the offenders.

For example, in the 1980s and 1990s, the response to urban violence was a law enforcement and prosecutorial campaign that cast participants in the drug trade, from users to major traffickers, as nefarious co-conspirators responsible for the destruction of their communities. An arsenal of legal tactics, aimed overwhelmingly at African Americans — confessions extracted through threats, indefinite detention awaiting trial, plea bargains in the face of a potentially decades-long imprisonment — was wielded to produce the facade of legal effectiveness.

The war on terror is also replicating this dynamic in response to the problem of horrific attacks on civilian populations: The solution is to turn the criminal justice system loose on those suspected of any link to a “terrorist enterprise,” whom the prejudices of the powerful ensure are almost exclusively Muslim American.

So while we most commonly see the phrase “witch hunt” today thanks to Trump’s false claim that he is a victim of one, we must learn that the real lesson of the witch hunts in 2020 is that attempting to solve complex problems with easy certitude is dangerous, especially when the costs of the solution are borne by others.