WASHINGTON — When all is said and done, President Donald Trump's trade war may be fated to fail. There are many reasons. One is that the target countries — prominently, China, Japan and Germany — won't accede to his demands. This is already happening. Another threat is a backlash among U.S. firms, hurt by tariffs that raise their products' prices. This, too, is happening.

But even if all these possibilities were avoided, the larger threat to Trump's trade agenda is the dollar's role as the major world currency. It dictates trade policy in ways not widely understood and is the ultimate cause of chronic U.S. trade deficits.

The dollar's role as the major world currency means it's used to settle trade transactions and make cross-border investments, even when Americans are not involved. As I've written before, the extra dollar demand boosts its value on foreign exchange markets. U.S. exports become more expensive and U.S. imports less so.

Trade deficits result. Since 1981, the United States has had only one current account surplus. (The current account is the broadest measure of the trade balance.)

When something continues that long, it's not an aberration. It's an integral part of the global economy. In effect, the dollar provides a service to the rest of the world.

We are compensated for this service by receiving imports greater than our exports. Many Americans benefit. Imports restrain inflation and expand consumer choice; the flows of money into dollar instruments (Treasury securities, bank deposits, stocks, bonds) tend to lower interest rates.

But there are losers: most conspicuously, U.S. farmers, manufacturers and their workers. They face tougher foreign competition in both import and export markets.

Or as economist C. Fred Bergsten of the Peterson Institute puts it: "There's a structural component to our trade deficits, which is the central currency role of the dollar. This produces a constant over-valuation in trade terms. ... We disadvantage ourselves by running the world's key currency."

(Note: Many economists reject this theory. The problem, they say, is that Americans want to invest more than they're willing to save. The gap is filled by an inflow of foreign capital converted into dollars. Despite differences, both theories operate similarly. They create a demand for dollars that affects the exchange rate.)

None of this is easy to convey to the public. Much simpler is Trump's narrative: U.S. trade deficits prove that other countries discriminate against American products; U.S. import restrictions are too loose. The cure is to eliminate the discrimination and to tighten import restrictions. The anti-American bias will disappear, as will large U.S. trade deficits.

It's a congenial theory, because — by assumption — trade deficits automatically become evidence that American firms are being victimized by someone, including their own government. If true, Trump's obsession with trade deficits would make sense. The trouble is that it isn't true.

The reality is that, well before Trump became president, global trade imbalances were shrinking. Figures from the International Monetary Fund (IMF) show that, as a share of the economy (gross domestic product), the U.S. current account deficit hit a recent peak of 5.8 percent in 2006 and dropped to 2.4 percent by 2017. The comparable figures for China were 9.9 percent of GDP in 2007 and 1.4 percent in 2017.

What caused the dramatic shift? Mainly changes in the business cycle, says a recent IMF report. Before the economy's collapse in 2008, strong spending generated huge trade flows and high oil prices. These produced large trade imbalances. When the Great Recession struck, these trends reversed. Trade flows weakened; oil prices fell; trade imbalances shrunk.

The implications are unexpected. Even by Trump's twisted view of trade, much of the needed adjustments have already occurred. If Trump succeeded — implausibly — in getting China and others to agree to reduce their trade imbalances, the needed changes would probably be milder than imagined.

"Maybe there was a case for seeking to limit disruption from China's exports during the 'China shock' period from 2001-2007 or so, when China's exports and trade surplus exploded in size," writes economist Timothy Taylor on his blog "The Conversable Economist." That case is now much weakened because trade imbalances "have dramatically declined ... well before any shots were fired in President Trump's trade war."

Trump has maneuvered himself and the country into a no-win conflict. He has infuriated America's allies by his reckless trade actions to raise tariffs and disrupt existing trade arrangements. If the impasse continues for months or years — a possibility — the damage to the world economy would be significant.

But even if these negotiations conclude successfully, the scope to make dramatic trade improvement is limited. The dollar's role as the major global currency imposes constraints. An appreciating dollar will tend to widen the United States' trade deficits. Trump has backed himself into a corner from which there is no easy exit.