Last week, Virginia Gov. Terry McAuliffe tried to assure supporters of the Trans-Pacific Partnership that Hillary Clinton will back the massive trade agreement if she becomes president. The rebuke from Clinton’s campaign chairman came quickly and harshly:

Donald Trump also opposes the TPP. And while delegates to both party conventions stopped short of denouncing the deal in their new platforms, both documents contain skeptical language about trade.

President Obama signed the TPP, but it has not yet been ratified. A liberal economist has called the TPP “Obama’s Vietnam.” Even though it’s become hugely unpopular, Obama still has to push for ratification to save face. And the deal may still fail in the end.

The agreement won’t go into effect if the U.S. doesn’t ratify it within two years, and at this point, practically speaking there are only two ways that can happen. President Obama and Congress could get it done during the lame-duck session. Or alternatively, Hillary Clinton could win and change her mind after the election. Edward Luce of the Financial Times calls this second scenario “virtually inconceivable,” though as Eamonn Fingleton has explained in these pages, flip-flopping on trade is something that Clinton does, if not well, at least frequently. She helped negotiate the deal, after all.

So what does the treaty do, and what tradeoffs does it pose?

Currently, international trade is governed by a patchwork of agreements, including hundreds of bilateral accords in addition to multilateral agreements like NAFTA. The TPP would override much of this infrastructure for the 12 countries party to it, covering a third of global trade with a single deal. An important signatory is Japan, which would substantially change its trade rules under the agreement. (The estimated benefits to the U.S. tripled when Japan joined.) An important non-signatory is China, trade with which has proven an unexpected threat to American jobs.

Naturally, the TPP will require nations to break down barriers to trade such as tariffs and other restrictions on imports. It also seeks to “harmonize” the ways that different countries structure their economies, including environmental regulations, intellectual-property protections, “state-operated enterprises,” and even corruption laws.

Supporters of the treaty tout a number of potential benefits. Most estimates suggest it could add marginally to America’s economy—somewhere in the general vicinity of 0.5 percent, a small gain because the U.S. already has low trade barriers with most of these countries—and boost exports in industries such as agriculture and manufacturing. If the analysis of the World Bank is to be believed, low-skill wages here will grow 0.4 percent while high-skill wages grow 0.6 percent thanks to the treaty.

The deal could be even better for poorer countries, at least relative to the current size of their economies: low-skill wages in Vietnam are expected to grow 14 percent. The gains could also be greater if the TPP becomes a global standard. It is designed to make it easy to add more countries.

China looms large as well. If the U.S. spearheads an enormous agreement that doesn’t include China—but does include many other countries in Asia, and takes aim at the “state-operated enterprises” China is fond of—it could set the norms China will have to abide by in the future, the argument goes. If the TPP fails, a different agreement China is putting together with its neighbors will grow in importance.

Opponents question a number of provisions. The intellectual-property rules in particular have been contentious, requiring strong protection of copyrights and patents; there’s certainly no denying that Hollywood and drug companies are strong TPP supporters. The “harmonization” provisions also raise obvious questions about sovereignty, and would allow foreign companies to challenge U.S. laws before international tribunals.

A broad skepticism of free trade also undergirds much of the opposition—the leading concerns being that the U.S. could lose manufacturing and service jobs—and economists are increasingly coming to share some aspects of this skepticism. The expert consensus is still that trade creates wealth on balance. But where economists once minimized the costs of trade—believing the free market would quickly fix any issues it caused—they are coming to see serious problems.

A recent paper by a team of leading economists lays out the new worries, focusing on the effects of trade with China. Its abstract is worth quoting in full (and the entire 45-page paper is worth a read for those who want to go deeper):

China’s emergence as a great economic power has induced an epochal shift in patterns of world trade. Simultaneously, it has challenged much of the received empirical wisdom about how labor markets adjust to trade shocks. Alongside the heralded consumer benefits of expanded trade are substantial adjustment costs and distributional consequences. These impacts are most visible in the local labor markets in which the industries exposed to foreign competition are concentrated. Adjustment in local labor markets is remarkably slow, with wages and labor-force participation rates remaining depressed and unemployment rates remaining elevated for at least a full decade after the China trade shock commences. Exposed workers experience greater job churning and reduced lifetime income. At the national level, employment has fallen in U.S. industries more exposed to import competition, as expected, but offsetting employment gains in other industries have yet to materialize. Better understanding when and where trade is costly, and how and why it may be beneficial, are key items on the research agenda for trade and labor economists.

Analyzing the TPP in particular, researchers at Tufts University present an even more dismal view. They say the deal would actually hurt the U.S.—reducing economic growth and median wages and costing hundreds of thousands of jobs.

The TPP would likely boost America’s economy and several major industries, and would help some poorer countries. But those overall gains are not certain, and trade can pose serious difficulties for some even where it increases overall wealth. On a political level, the agreement is completely out of step with America’s increasingly nationalistic popular sentiment—and candidates know that not only economists show up on Election Day.

Robert VerBruggen is managing editor of The American Conservative.