Since the time of Adam Smith, economists have understood that free trade is good for countries as a whole.

Of course, trade creates winners and losers. The most common opinion expressed on TV talk shows and in the current presidential campaign is that the winners are on Wall Street and the losers are ordinary people.

However, the latest research suggests the opposite is true. The biggest winners from free trade are in the bottom half of the income distribution. What’s more, these gains are so large that if real income were measured properly, inequality in the US has been falling not rising – precisely because of increased trade.

The argument for trade is straight forward. Trade is ultimately the trade of goods for goods. In any voluntary exchange, both parties are made better off. Both give up something they value less for something they value more.

But what if other countries sell to us without buying from us? That’s what a trade deficit means. It turns out that trade deficits aren’t bad. If China sells to us and just holds onto the dollars it gets in return, then China is holding paper and we are consuming the real goods they produced. That’s not bad for us.

What is more likely is that China uses the dollars it obtains to buy stocks and bonds and other financial assets back here in the United States. That’s not bad either. It means we get to consume the goods that China sends us and instead of buying goods from us China decides to increase the size of our capital market. Capital is something poor countries lack. Financial capital buys newer and better factories and equipment. It makes workers more productive and allows them to earn higher wages. When China invests in the US, that’s good for American workers, on the average.

Throughout the 19th Century the US ran a trade deficit with Europe, especially Britain. That brought needed capital to our shores, contributed enormously to our economic growth and allowed us to become the richest country in the world.

So much for the economics lesson. What about the human costs of all this?

More trade almost always means more jobs and higher wages in our exporting industries. It tends to mean fewer jobs and lower wages in the industries that compete against the imports. These changes are not small. According to one study, between 2000 and 2007 the U.S. lost 982,000 manufacturing jobs because competition from Chinese imports. However, there is no evidence that trade reduces employment overall.

More trade also means lower prices for the consumers of imported goods. A study by the (union funded) Economic Policy Institute, concludes that 400,000 US jobs were eliminated or displaced between 2001 and 2013, because of Walmart, the nation’s largest retailer and biggest importer.

Even if we accept this estimate, it completely ignores the upside. Millions of American’s are paying less for goods at Walmart than they otherwise would have paid. That means their incomes stretch farther. That means their standard of living is higher.

Thanks to Bernie Sanders and Donald Trump, a lot of attention has been given to the job losses. Almost no attention has been given to the job gains or to the increase in our standard of living.

For example, a study by economists at the University of Chicago discovered that imports are holding down price increases the most for the types of consumer goods lower-income households buy. For example, the prices of non-durable goods purchased by the bottom 10th of the income distribution increased by 0.4 percent per year, while the increase was 11.9 percent for those in the top 10th of the income distribution and 13.4 percent for the richest 5 percent of households.

Another and more recent study by economists at UCLA and Columbia University measured the gains from trade among all countries and concluded that those in the bottom 10th of the income distribution had a 63 percent gain while those in the top 10th had a gain of 28 percent.

There will always be winners and losers from trade. But on the whole, trade appears to make incomes more equal, not less so.