International trade – how we do it, who we do it with, and what impact it has on the American worker – has become a significant issue on the presidential campaign trail. Opposing the trade status quo and new pending trade agreements are central tenets in the campaigns of both Bernie Sanders and Donald Trump. The support they’ve found for those positions and the discontent they’ve tapped into has put pressure on other campaigns to follow their lead.

“I don’t want to say we could have called it,” said MIT economist David Autor. “But we can at least say there’s stuff that we missed that had we known, we wouldn’t have been as surprised as we’ve been.”

For several years, Autor and colleagues have been studying voter behavior in areas of the U.S that have been hard hit by competition from China — places that made a lot of furniture, shoes, or clothes, for example. They analyzed the outcomes of House elections from 2002 to 2010.

“What you see is that areas that have been heavily trade-exposed have been removing moderates from office, moderate Democrats particularly and moderate Republicans as well, and then electing more ideologically strident officials,” Autor said.

In other words, voters hurt by trade are more drawn to conservative Republicans on one end and, to a lesser extent, more liberal Democrats on the other.

Autor and colleagues found further polarization when looking at voters by race. In majority-white voting districts, “you see very sharp movements to the right,” he added. However, in majority-minority districts, “it’s precisely the opposite — moderate Democrats removed and liberal Democrats put in office.”

Autor says these earlier elections help explain support for Donald Trump on the right and Bernie Sanders on the left; their appeal is the continuation of a narrative that reaches back more than a decade.

Zooming out beyond trade-impacted areas, trade becomes less divisive for the average American.

During the recession and its aftermath, polling by Gallup found more Americans where likely to feel foreign trade was a threat to the US economy than an opportunity for growth. But for the last four years, the majority of Americans have favored foreign trade.

As of February, 58 percent of Americans said they view foreign trade as an opportunity for economic growth through increased U.S. exports, while 34 percent saw trade as a threat, due to foreign imports.

“That’s consistent enough now for several years to lead us to believe that’s a pretty firm attitude,” said Frank Newport, Gallup’s editor in chief.