China trade issues featured prominently in Donald Trump’s campaign, as evidenced by his intention to declare China a currency manipulator and to levy a 45% tariff on its exports to the U.S. The rhetoric has considerable appeal, even if the logic is conceptually flawed. The fact that China accounts for the largest share of America’s trade deficit further lends credibility to the storyline that Beijing has kept the yuan undervalued for competitive reasons.

In fact, there is no direct link between the emergence of American trade deficits and China’s trade surpluses. Moreover, there is little evidence that an undervalued yuan played a major role in driving China’s trade surpluses over the past decade. China’s success in becoming the world’s largest exporter was the consequence of joining the World Trade Organization and the evolution of the East Asian supply-chain network.

The confusion comes from misreading the implications of China as the point of final assembly for Asia-produced parts into finished products for shipping to the U.S. This makes it difficult to determine which country is responsible for products that end up in American stores.

Historical numbers clearly show that U.S. and China trade balances are not directly linked. America’s overall trade deficit became enormous around the late 1990s and only began to moderate around 2009. But China’s trade surplus did not become significant until around 2005. How could China be responsible for America’s trade deficits, when in fact, America’s deficits emerged long before China even became an export power?

A trade deficit is often the result of excessive government deficits and/or households consuming beyond their means—both of which have characterized the American economy over the past several decades. In such circumstances, a large trade deficit is inevitable and which countries report the offsetting trade surpluses is incidental.

America’s bilateral trade deficits were concentrated among the more developed East Asian economies in the 1990s, notably Japan, South Korea and Taiwan. This then shifted to China after the latter became the center of the regional production sharing network following its WTO membership in 2001.

U.S. manufactured imports from Pacific-Rim countries have remained at about 45% of total U.S. manufactured imports from 1990 to 2014, but China gradually captured an increasing share of Asia’s exports to the United States as the last stop in the global assembly chain. Thus the appearance that U.S. trade deficits are linked with China’s surpluses is misleading; it is really about deficits with East Asia more generally, with much of the higher value components being produced by other countries.

The other major source of tension is the perception that China’s export strength is due to its exchange rate being deliberately undervalued, giving it an unfair advantage. China unified its dual exchange rate system in 1994 at 8.27 yuan to the U.S. dollar and stayed pegged at this rate until 2005.

Through the early 2000s, the yuan was widely seen as over not under-valued. Ironically, China was widely praised by U.S. officials during the Asian Financial Crisis for not devaluing its currency when many other Asian currencies had collapsed.

What eventually helped China to generate significant trade surpluses had really nothing to do with its exchange rate. That boost came from easier access to Western markets through the WTO. Membership provided incentives to ratchet up productivity-enhancing infrastructure investments which caused labor productivity to soar. Structural shifts, not an undervalued exchange rate, were the major factors driving China’s export capabilities.

Appreciating the exchange rate helped to moderate trade surpluses once they did emerge. When China’s trade surpluses increased to 5% of GDP by 2005, it moved away from a fixed peg to the U.S. dollar. Appreciation of its nominal exchange rate and increasing consumer prices contributed to China’s real effective exchange rate strengthening by about 50% by the end of 2015.

While this rapid appreciation helped moderate China’s trade surplus, its impact was much less than expected. Much more important was the surge in China’s investment and rising imports coupled with slackening demand from the United States and Europe as their economies went into recession. China’s current account surplus fell to around 2% to 3% by 2012, where it has remained as of 2016, from a high of 10% of GDP in 2008.

Studies show that adjustments in exchange rates now have a much smaller impact on trade balances because of the increasing reliance of manufacturers on imported inputs for production. As a consequence, if exchange rates appreciate, exports do not fall that much because the cost of imported inputs will decline. This is especially relevant for China given the very high share of imported inputs in its exports of finished products to the West.

This article was originally published in the Wall Street Journal.