The election of Donald Trump has put a spotlight on the loss of American manufacturing jobs and the role globalization has played in those losses. Dean Baker argues that trade policies put in place in the late 1990s were designed to allow Asian countries to run trade surpluses so that they could repay debts owed to U.S. banks and other lenders. These trade surpluses, in turn, led to a ballooning of the U.S. trade deficit and exposed American manufacturing workers to low wages in developing economies. There was nothing inevitable about the trade deficits and job losses in manufacturing, which contributed to growing inequality in the United States, according to Baker. Although they may disagree on details, Baker and Trump broadly agree that the system is rigged in favor of the rich and at the expense of the working class.

Behind Baker’s argument that U.S. globalization policies have harmed the working class and contributed to growing inequality is the premise that trade is, to a large degree, responsible for the decline in manufacturing jobs. Although I agree, many, including fellow economists, do not. They maintain that the U.S. manufacturing sector is strong in spite of trade and that automation is responsible for the hemorrhaging of jobs. This alternative view is commonly used to dismiss concerns, such as Baker’s, about globalization policies. It is important to explain why it is wrong.

The rapid pace of globalization has contributed to two of the most important economic problems currently facing the United States: underemployment and high inequality.

Although manufacturing’s share of employment in the United States has been declining for decades, the number of manufacturing workers was relatively stable until the 2000s. Many manufacturing processes were automated by then, but output had grown to meet increased demand, offsetting automation’s effects on jobs. Research finds that, were it not for increased use of temporary help in factories, the number of jobs recorded in the manufacturing sector would have grown during the 1990s.

Beginning in the last years of the decade, the situation abruptly changed. Between 1998 and 2007, manufacturing employment fell by 22 percent. The sector declined further still during the Great Recession. By 2015, 5 million factory jobs had been lost. These losses coincided with a surge in the trade deficit in manufactured goods and a sharp decline in the number of factories operating in the United States.

Those who argue that trade has played little role in large manufacturing employment losses appeal to a different, seemingly contradictory set of statistics. They point to inflation-adjusted manufacturing output, which has grown almost as fast as economy-wide GDP since 2000. Robust output growth coupled with employment declines translates into rapid labor-productivity growth, which supports the narrative that automation is responsible for manufacturing’s job losses in recent years.

That narrative is amplified by experts and the mainstream media, discrediting concerns about deindustrialization and policies that might revitalize the manufacturing sector. A recent New York Times essay asserts, “There can be no revival of American manufacturing, because there has been no collapse. Because of automation, there are far fewer jobs in factories.” Similarly, an analysis from the University of Pennsylvania’s Wharton School concludes, “The biggest reason Trump—or anyone else—can’t bring back jobs is because there is nowhere to bring them back from. They have been lost in large part to the success of efficiency. Manufacturing output in the United States was at an all-time high in 2015.” And a Washington Post article titled “A single chart everybody needs to look at before Trump’s big fight over bringing back American jobs” features a graph plotting strong output growth against sharp employment declines since 2000. “American workers may be struggling,” the Post says, “but American factories are not.”

This claim, that U.S. manufacturing is doing well, reflects a fundamental misreading of the numbers. True, according to official statistics, manufacturing output was around 40 percent higher in 2015 than in 1997. But just one industry—computer and related electronics, which only account for about 15 percent of the sector’s value added—drives the apparent robust growth. Output in this industry, adjusted for inflation, increased by a staggering 700 percent between 1997 and 2015. In contrast, output growth was weak or negative in most other manufacturing industries during the period. Without the computer industry, output in manufacturing was just 8 percent higher in 2015 than in 1997, and it was five percent lower in 2015 than before the recession.

Many economists believe that automation, and not globalization, is responsible for the decline in jobs. They are wrong.

Moreover, the extraordinary growth in computer and related electronics does not demonstrate the international competitiveness of domestic manufacturing in this industry segment. Rather, as my research with Timothy Sturgeon and Timothy Bartik documents, the apparent strength in this industry is largely an unintended outcome of technical adjustments to statistics. Even as computer and related production were driving what looked like strong growth in the manufacturing sector, the industry’s locus of production was shifting to Asia.

For technical reasons, then, the computer industry skews manufacturing output growth statistics. By netting out the effects of this industry, it becomes apparent that output in the rest of the sector, which accounts for 85 percent of value added, has barely grown since the late 1990s, even though Americans are purchasing lots more manufactured goods.

This pattern is consistent with statistics showing a ballooning trade deficit in manufactured goods and a sharp decline in the number of factories operating over the period. U.S. consumers and businesses increasingly purchase imported products, and American exports have not risen commensurately with imports. Instead of manufacturing in the United States and exporting to foreign markets, U.S. multinational companies often locate production overseas to take advantage of lower labor costs and taxes, among other benefits of offshoring.

Technology has reduced the need for workers in factories, just as it has in other workplace settings. The critical difference is that, in contrast to other sectors, the amount produced in most manufacturing industries has barely risen, or has declined, since the late 1990s. Anemic output growth, combined with continued automation of manufacturing processes, has led to the steep decline in manufacturing jobs. Competition from low-wage countries has likely accelerated the adoption of automated processes in some U.S. industries.

The rapid growth in the computer industry, however, masked the sector’s weakness. This caused, or allowed, leaders in government, policymaking, and the media to minimize the impact of globalization on the international competitiveness of domestic manufacturing and on jobs.

It can take a community a generation or more to recover from the adverse effects of mass layoffs.

Job declines due to poor manufacturing performance have not been confined to that sector. Production requires extensive supply networks; roughly half of workers involved in making goods are employed outside of manufacturing. And the adverse effects of mass layoffs spill into communities, as unemployed workers cut back on spending. Plant closures can overwhelm a local economy. Many laid-off workers have difficulty finding new employment or are forced to take less pay elsewhere. It can take a community a generation or more to recover. Research links sudden, large-scale employment losses in manufacturing to wider employment declines in the 2000s, particularly among the non-college educated, many of whom have dropped out of the labor force.

One might ask, doesn’t the reduction of barriers and expansion of trade lead to greater efficiencies? Although the pursuit of free trade has winners and losers, aren’t the gains always greater than the costs? By that logic, Baker pointedly argues, we also should allow low-wage doctors, lawyers, and other professionals from developing countries to practice in the United States, and we should reduce patent and copyright protections. Such policies would adversely affect the wealthy. Some policies are pursued in the name of efficiency and others are not—illustrating how the system is, as Baker puts it, rigged.

Low trade barriers do yield benefits to consumers in the form of lower prices. But the theory behind the simple free-trade prescription assumes, among other things, full employment. In the perfect world of that economic model, workers displaced from their jobs find new work immediately, at no cost. Reality is different. When an opening of markets results in sudden, large-scale dislocations, as occurred in the 2000s, the effects can be lasting and deleterious.

The rapid pace of globalization, though not the sole cause, significantly contributed to two of the most important economic problems currently facing the United States: underemployment, particularly among those without a college education, and high inequality. It helped fuel the presidential candidacy of Bernie Sanders and propel Donald Trump to the White House. As Baker argues, it is time to stop denying the effects of U.S. policy choices when it comes to globalization. We need to start addressing the consequences.