Gene Epstein explains for Barron’s readers why both Hillary Clinton and Donald Trump miss the boat when they criticize the impact of free trade.

Free trade often comes under fire during presidential elections, laced with tough talk about spurning cheap Chinese imports—and not just from Donald Trump and Hillary Clinton. Seeking re-election in 2012, President Barack Obama baited Republican challenger Mitt Romney as “the last person who’s going to get tough on China” with respect to trade, while claiming credit for measures to ensure that “China was not flooding our domestic market with cheap tires.” Romney might have asked if it troubled Obama that, due to his actions, Americans were paying more for tires than they needed to. Instead, Romney lamely promised “tariffs” if China took “unfair advantage of our manufacturers.”

That was just a warm-up act for the current dust-up on trade. This year’s two main contenders for the White House have brought trade-bashing to a new level, with each side following the usual flawed script. Americans are referred to only as workers hurt by cheap imports, never as consumers for whom cheap imports boost real incomes. Even the candidates’ concern for lost jobs has strict limits. Jobs matter to Trump and Clinton only if they are with domestic employers that compete directly with foreign-based firms.

Workers whose jobs in the U.S. depend on cheap imports are off the candidates’ radar. One example of this is the smartphone, an import assembled by cheap labor in China. That smartphones can be offered at a relatively low price makes them a household item that has spurred domestic employment on all levels of skill, from Uber drivers and phone store employees to programmers developing new apps.

The Republican candidate would slap tariffs on imports from Mexico and China, and Clinton has joined Trump in opposing the Trans-Pacific Partnership, a trade agreement she once supported. TPP’s specific provisions for reducing tariffs and trade quotas seem long overdue, but the agreement’s over 5,500 pages of text cover more than just trade, prompting dissent even from some free-trade advocates. The two candidates ignore such nuances, however, condemning TPP in sweeping terms, with Clinton declaring that she decided to oppose it because “I didn’t think I could look in the eyes of any American worker and say this deal will create more jobs and raise your wages.”

Assuming the candidates believe their own rhetoric, they are flunking elementary economics. They seem unaware of the fact that every worker is also a consumer who benefits from cheap imports, that cheap imports bought by U.S. firms often create jobs that more costly imports can destroy, and that it’s possible to be compassionate toward people who lose their jobs without invoking the boogeyman of foreign competition. Even the highest estimates for jobs lost to foreign trade run a little over 300,000 a year, which is roughly equivalent to one week’s total for new unemployment insurance claims. And that relatively small number omits the jobs that foreign trade helps create.

Perhaps most important of all, a widening trade deficit correlates with prosperity, while a shrinking deficit correlates with slumps and recessions. So if candidates favor prosperity, they will almost inevitably face widening deficits. The reason is fairly straightforward. When times are good, demand rises along with imports, widening the trade deficit; when times are bad, demand falls along with imports, narrowing the trade deficit.