You might see a fair number of witches out and about this Halloween; they’re a staple of the season. But odds are low that you’ll see any of them burned at the stake or hanged.

Fox News host Tucker Carlson recently asked a self-identifying witch who claims she cast a magic spell on the president, “Is this legal? … Is there any kind of federal regulation on this?”

In the United States, it is indeed permissible to wear black and try to cast spells to your heart’s content.

That’s not the case in some several parts of the world:

In August, villagers lynched an alleged witch in one of the poorest parts of India. Earlier this year, Tanzanian widow Ruth Zacaria fell victim to a witch hunt. Her attackers alleged that she prevented their family from being able to afford a particular property by using witchcraft to kill their father, bringing them to financial ruin. One witness to a witch hunt in Tanzania in 2015 described the situation in harrowing detail: “They broke into the house and hacked my wife with machetes and knives. They burned the body of my wife and later set fire on my house.”

Beliefs undoubtedly play a role in motivating these killings, and some people imagine that witch hunts result solely from cultural, not economic, factors. But as University of California-Berkeley’s Edward Miguel noted in his a study on witch killing, “Poverty and violence often go hand in hand,” and economic desperation frequently leads to scapegoating and slaughter.

Village mobs and individual families strangle, burn alive, knife or beat to death thousands of alleged witches each year, mainly in impoverished parts of the world. The Thomson Reuters Foundation estimates that in 2017, the deaths at the hands of vigilantes have numbered about 80 a month in Tanzania. Most victims are women. And an Indian law firm says it is “only the most gruesome cases that are reported — most cases of witch hunting go unreported and unrecorded.”

Miguel’s study found that in the extreme poverty of rural Tanzania, after a poor harvest, women are frequently blamed and murdered for witchcraft. In years where unusual rainfall ruins crops and creates near-famine conditions, there are about twice as many witch killings as in other years. Poor families are the most likely to murder alleged witches.

During the early 17th century, when witch killings were common across Western Europe, Germany’s average income was nearly identical to Tanzania’s in 2010: just over $800 in 1990 international dollars per person.

The Salem witch trials

Famously, America had its own smaller scale witch panic at the end of the 17th century, when its average income was roughly $900 by the same measure.

It seems that even in America, poverty was partly to blame for the killings. The majority of the charges in Salem were leveled by economically desperate farmers against more prosperous merchant families, according to the authors of Salem Possessed: the Social Origins of Witchcraft.

Unsurprisingly, the Salem madness was preceded by a series of unusually cold winters causing crop failures. Cold weather and subsequent deteriorating economic conditions also correlated with more witch killings in Europe, just as crop-ruining rainfall levels often precede witch hunts in Tanzania.

Poverty and ignorance do not always lead to witch hunts, but they seem to make violence more likely. For one 14th century site excavated in South Dakota, an astonishing 60 percent of the population died in conflict. Many of the bodies show not only signs of violent death but also extensive nutritional deficiencies, suggesting starvation-level poverty preceded deadly violence.

One reason for violence’s decline that Harvard University’s Steven Pinker identifies is capitalist peace theory: when it’s easier to buy things than steal, people don’t steal. Hence trade and commerce between countries reduce the exploitative incentives of military conquest.

Of course, trade doesn’t guarantee peace. Europe enjoyed abundant trade before World War I. But in general, as people move from subsistence to exchange and from poverty to prosperity, they become less desperate and violent. As prosperity enables education to spread, belief in witchcraft fades. After a poor harvest, instead of witch hunts energy is poured into innovative ways to ensure better crop yields next year.

If you see any witches this Halloween, take a moment to contemplate the incredible strides that humanity has made against poverty and violence. While progress can be uneven and there are still places where “witch” is a deadly accusation, declining poverty helps to end witch hunts and makes the world less violent.

This first appeared in USA Today.