WASHINGTON — The U.S. trade deficit reached its highest sum ever last year, defying President Donald Trump’s efforts and promises to shrink it through his economic policies. The irony is that those policies likely contributed to the deficit.

Trump entered office insisting that decades of trade gaps had crushed the U.S. economy and that he would forge new agreements that would diminish the deficits.

It hasn’t happened.

The government said Wednesday that the U.S. trade gap in goods and services reached $621 billion last year, its highest total since 2008. And the U.S. deficits in goods with China and Mexico surged to record highs.

As president, Trump’s signature effort to stimulate U.S. growth — deficit-funded tax cuts — likely helped fuel the willingness of American corporations and households to spend, including on imported goods. That is especially true at a time when much of the rest of the economic world has weakened and is less likely to buy U.S. goods. The result has been more imports than exports.

What’s more, the tariffs Trump imposed on steel, aluminum and hundreds of billions’ worth of Chinese goods likely contributed to the trend: During 2018, American companies that import goods from China appeared to accelerate their spending on them to avoid Trump’s future import taxes.

Here is a look at the trade deficit and its causes and effects:

What is the trade gap?

Trump often misrepresents the trade deficit. He has frequently labeled it an outright economic loss.

“We’ve been losing, on average, $375 billion a year with China,” the president said in February, referring to the 2017 deficit in goods between the United States and China. That imbalance surged to $419.2 billion in 2018 under Trump’s watch.

The ability and willingness of Americans to spend, including on imports, is generally a healthy economic sign.

Yet the trade gap isn’t an outright loss. It simply reflects the greater value of what the United States imports compared to what it exports. And it’s not necessarily a cause for concern.

Last year’s trade deficit paid for smartphones, kitchen appliances, clothing, auto parts and a whole range of goods that were made more affordable because of China’s lower manufacturing costs.

Those lower costs have indeed contributed to the loss of U.S. factories to foreign countries and devastated vast swaths of the industrial Midwest.

But lower import prices have also benefited companies and millions of consumers in ways that boosted the U.S. economy — 70 percent of which consists of consumer spending. The ability and willingness of Americans to spend, including on imports, is generally a healthy economic sign.

In its relationship with China, a bigger problem for the U.S. economy than trade deficits is the widespread suspicion that Beijing steals intellectual property and requires American companies that operate there to turn over technology secrets — two issues at the heart of the administration’s negotiations with Beijing.

Such policies weaken the ability of U.S. companies to compete and inflict billions in losses, according to a report last year by Lee Branstetter, an economist at Carnegie Mellon University and a fellow at the Peterson Institute for International Economics.

Are trade gaps bad for the economy?

Not always.

In the accounting for the nation’s gross domestic product — the broadest gauge of the economy — a trade deficit does subtract from growth. But last year’s higher U.S. trade gap resulted mainly from the economy’s strength, notably robust spending on imports.

WATCH: Who holds the power in potential U.S.-China trade war?

Indeed, the last time the trade deficit narrowed by a significant amount, it was because the economy was mired in a devastating downturn — the Great Recession, which lasted from late 2007 to mid-2009. The trade gap in goods sank 38 percent in 2009 to $503.6 billion.

By contrast, in 2018, after years of economic expansion, the gap in goods had swollen to a record $878.7 billion.

Did anything else widen the trade gap?

Kimberly Clausing, an economist at Reed College, points to a sharp increase in government borrowing. The tax cuts that Trump signed into law reduced federal revenue by 1 percent of GDP. This meant the United States had to resort to additional borrowing to help drive growth.

Trump had pledged both faster growth and lower trade deficits. But his impulse to achieve faster growth through government borrowing contributed to a wider trade gap.

“A budget deficit is the public sector adding additional borrowing to the U.S. economy, making the gap between our spending and our earning even larger,” Clausing said. That increase contributed to the wider trade gap.

Another factor in the increased trade deficit has been a stronger dollar, another sign of economic health. A higher-valued dollar, compared with other nations’ currencies, makes the goods that Americans import relatively more affordable and our exports comparatively more expensive overseas. That disparity has helped drive up demand for imports over exports.

Why didn’t Trump’s tariffs curb the trade deficit?

Researchers at the New York Federal Reserve examined this issue last year. Tariffs and counter-tariffs make goods more expensive. This can lead to declines in both imports and exports. When both imports and exports drop, the trade deficit can’t easily improve.

And Trump’s threat of tariffs probably worsened the situation last year, said Stephen Stanley, chief economist Stephen Stanley at Amherst Pierpont Securities.

READ MORE: Why a meaningful U.S.-China trade deal could be hard to reach

The White House initially charged a 25 percent tax on $50 billion of Chinese imports in June. In September, it imposed a 10 percent tax on an additional $200 billion of Chinese goods. And it threatened to escalate that tax to 25 percent at the start of 2019 and essentially impose tariffs on all Chinese imports unless progress was made in trade talks.

Trump suspended the additional tariff hikes. But his threat likely caused importers to bring more of their goods into the United States before January to avoid the risk of a higher tax, Stanley said. This action turned out to inflate the trade gap.

How does the trade gap affect ordinary people?

On a day-to-day basis, not very much. The U.S. economy amounts to about $20 trillion a year, a sum so huge it is difficult to fully fathom. The trade gap last year was equal to only about 3 percent of that sum.

But trade battles do have consequences. Trump’s tariffs on imported washing machines, for example, caused that sector’s prices to shoot up. And businesses that depend on Chinese imports say they’re grappling with higher prices.

In the view of the vast majority of economists, trade wars of the kind Trump has instigated benefit no one in the long run. And by themselves, they don’t typically produce any meaningful change in the trade deficit.