Sebastian Mallaby is a senior fellow at the Council on Foreign Relations and a Washington Post Global Opinions contributing columnist.

Sit through any tech conference these days, and the gap between scientific optimism and our current political pessimism is extraordinary to behold. There are speeches on gene silencing, which promises breakthroughs in the treatment of dementia; on plant-based beef substitutes, which could reduce the bovine boost to global warming; on computers that will screen your skin for cancer and your refrigerator for dwindling milk. But voters across the Western world aren’t celebrating these excitements. To the contrary, they are furious.

We have been here before, of course. On Carnival Day in 1497, the Dominican friar Girolamo Savonarola piled the trappings of Renaissance progress — heretical books, provocative paintings, imported baubles symbolizing globalization — into a towering heap in Florence’s central piazza and set fire to the lot. Recalling that first Bonfire of the Vanities in their new book, “Age of Discovery,” Oxford thinkers Ian Goldin and Chris Kutarna note its weirdly 21st century irony. Savonarola denounced modernity. And yet, like Donald Trump or the Islamic State, he also exploited it, spreading mass propaganda via the new communications technology of the printing press.

Some theories of Trumpism — or of Austria’s Hoferism or Britain’s Brexitism — emphasize voters’ misfortunes: conventionally measured, middle-class incomes are stagnant. But this theory of populism’s rise is not fully convincing. Standard measures of incomes leave out the eye-popping array of stuff we don’t actually pay for — the technocopia of free Internet searching, messaging services, selfie apps, exercise programs, YouTube videos and so on. What’s more, populism afflicts countries where even conventional measurement shows progress. Poland and Hungary have both seen gross domestic product per person roughly triple since 2000. But both countries are in the grip of populist strongmen.

A more convincing theory of populism is that it can sometimes be the product not of stagnation but of progress — particularly the sort of progress generated by the disrupters of techland. Like migration or globalization, fast technological change is both positive and disorienting; it clutters life with minor stresses, like bewildering TV remotes and dual-key passwords, but also with existential ones, like the specter of intelligent robots stealing all the jobs. Of course, the grumbling about these costs may be illogical, given technology’s huge benefits. But people aren’t logical. After the 2008 crisis, it became a cliché to lament the irrationality of financial traders and to point sagely at the human biases that behavioral economists identified back in the 1970s. Guess what: Voters are no different.

Indeed, the biases identified by behavioral economists tell you plenty about Trump. Why are his backers so resentful of a world in which incomes, properly measured, have probably done respectably? Well, a classic behavioral game involves offering a player $1 on the condition that another player gets $9. Even though a “rational” actor would accept the $1 gain in income, most real people resent others doing better, and they feel that resentment passionately enough to reject an offer that would make them better off. So it may not be enough that technological advances help almost everyone. For tech to be broadly welcomed, it has to spread its benefits at least somewhat evenly.

Then there is the strange matter of people’s attitude to loss. Behavioral economics finds that people suffer “loss aversion” — they fear losing $10 more than they celebrate a gain of the same size. This helps to explain why Trump’s supporters fear threats more than they welcome opportunities — whether these arise from migration, globalization or technology. At the same time, however, “prospect theory” suggests that, once people have suffered losses, they will gamble recklessly to recoup them. This insight is usually wheeled out to explain why investors hang on to stocks that have lost value, or why losing football teams attempt “Hail Mary” passes. There could be no greater Hail Mary gamble than voting for Trump.

After the financial crisis, the world responded with reforms to avert another crash. Now, given the populist crisis, the world needs a response of an equivalent size. Policies that promote growth and efficiency must be balanced with policies promoting fairness and security. Just as banks now hold more capital, even at the expense of their return on equity, so society must be prepared to tax more progressively, curb runaway executive pay and fix the gaps in social safety nets. Schemes such as wage insurance, which pay subsidies to displaced workers when they move into lower-paying occupations, may seem dauntingly expensive. They are a lot less expensive than electing populist firebrands.