Where have all the manufacturing jobs gone? If you ask Republican presidential candidate Donald Trump, the answer is clear: China! But there is another, more plausible explanation. To paraphrase Democratic presidential candidate Hillary Clinton, “It’s the robots, stupid”.

The U.S. has lost 5 million factory jobs since 2000. And trade has indeed claimed production jobs – in particular when China joined the World Trade Organization in 2001. Nevertheless, there was no downturn in U.S. manufacturing output. As a matter of fact, U.S. production has been growing over the last decades. From 2006 to 2013, “manufacturing grew by 17.6%, or at roughly 2.2% per year,” according to a report from Ball State University. The study reports as well that trade accounted for 13% of the lost U.S. factory jobs, but 88% of the jobs were taken by robots and other factors at home.

If not China, what then explains these jobs losses? It’s simple: factories don’t need as many workers as they used to, because robots increasingly do the work.

Investment in automation and software has doubled the output per U.S. manufacturing worker over the past two decades. Robots are replacing workers, regardless of trade at an accelerating pace. “The real robotics revolution is ready to begin” writes BCG and predicts that “the share of tasks that are performed by robots will rise from a global average of around 10% across all manufacturing industries today to around 25% by 2025.”

With increasing automation, the manufacturing industry is becoming more productive. From 1998 to 2012, all sectors experienced a productivity growth of 32% when adjusted for inflation – the production of computer and electronic products rose 829%. The researchers at Ball State University calculated: If 2000-levels of productivity are applied to 2010-levels of production, the U.S. would have required 20.9 million manufacturing workers instead of the 12.1 million actually employed.

With the rise in productivity, many workers are moving up the economic ladder. However, those who fail to meet rising requirements – probably many less-educated Americans – risk to fall into the lower class. “Since the 1960s, manufacturing has always paid substantially more than the minimum wage. Even today, the manufacturing jobs that remain average $20.17 an hour. That’s nearly three times the federal minimum wage.

Robots will help companies and brands move manufacturing closer to markets. Customer needs and increasing scale will decelerate the global search for cheap labor. With scale the prices of robots come down. BCT projects that “growth in the global installed base of advanced robotics will accelerate from around 2% to 3% annually today to around 10% annually during the next decade.

Many of today’s customers demand fast products, such as fast fashion with quickly changing models. Producing far away is only then still an option when margins are high and able to absorb high transport cost for air transportation. Moving closer to markets means more distributed manufacturing which reduces also the impact of disruptive events, such as the tsunami in Japan and the flooding in Thailand.

Focus on manufacturing pays off. One example is Greenville, South Carolina. Greenwille was for decades the state’s heart of the textile industry till its gradual decline when confronted with competition from Mexico and South East Asia. “In 1990, 48,000 people still worked in textile manufacturing in the Greenville area, according to the U.S. Bureau of Labor Statistics. Today fewer than 6,000 do” we can read in MIT Technology Review.

However, investments created new jobs and brought unemployment below the national rate. Loyalty and commitment to production have attracted major global manufacturers, such as BMW, ABB, Fluor, Michelin, Bosch, and General Electric’s power division. Investments created new jobs, but with different skill requirements. The factories are highly automated. Those workers who had not been trained and able to make the transition to jobs that require far more computer and technical skills were left behind. Consequently, Greenville has to deal with twice the number of people collecting food stamps than a decade ago.

The U.S. needs to aim at leading the adoption in robotics. According to the BCG report, manufacturing labor costs in 2025 are expected to be 33% lower in South Korea for example and only 18% to 25% lower in the U.S. Therefore, South Korea is estimated to improve its manufacturing cost competitiveness by 6 percentage points relative to the U.S. by 2025. Focus need as well as skilled workers due to the fundamental shift in competences and because programming and automation talent will replace low-cost labor as key drivers of manufacturing competitiveness.

The focus on China is diverting energy from the real challenge. This is not only misleading but puts at risk the future of the U.S. economy.

Wolfgang Lehmacher is head of supply chain and transport industries at the World Economic Forum.