The economic history of the last 40 years can be summed up in four words: “before China” and “after China.”

Before China opened up, the world's center of economic gravity was on the Atlantic. After China did, that started migrating toward the Pacific. Before China embarked on its market reforms, its average standard of living was 2.5 percent of ours. After China did, that rose to 28 percent (and counting). And before China established permanent trade relations with us, we had 17 million manufacturing jobs. After China did, that fell rather rapidly to around 14 million.

That last part has become politically radioactive in the age of President Trump. Indeed, he took to Twitter Thursday to deliver a pair of particularly aggressive missives about his upcoming tete-a-tete with Chinese premier Xi Jinping — their first since an election in which Trump used China as something of a political piñata — to declare that the U.S. trade deficit with them is intolerable, and, in what has become a semiregular threat to start a trade war, that U.S. companies should be ready to look “at other alternatives.”

But does Trump actually have a point when he says that our “massive trade deficits” with China are causing “job losses”? After all, they have engaged in what can only be described as neo-mercantilist policies, like keeping their currency artificially cheap to give their exporters a leg or two up against foreign competition. Well, the short answer is that it depends.

The dirty little not-so-secret of free trade that economists generally don't like to admit is that it isn't good for everybody. Sure, it makes us better off as a whole, but you and I aren't wholes. Think about it like this. Trade is just like a technology. It allows us to do more with less, just due to the magic of specialization rather than robots. But, as the Luddites could tell you, progress doesn't always mean that you're getting ahead. Luddites, remember, were the weavers who responded to the Industrial Revolution by trying to destroy the machines that had destroyed what had up until then a semiskilled, and decently paid, profession. In other words, even things that are good for us in the long run aren't good for all of us in the meantime. In fact, they can be quite devastating.

Economists, for the most part, try to brush this off when it comes to trade by saying that we can just redistribute enough of the gains from the winners to the losers so that everybody is better off. That's true in theory, but so is the idea that I wouldn't age much if I could travel at the speed of light. If recent experience is any guide, though, both have about the same chance of happening.

Which brings us to China. Never before have so many people with so much infrastructure entered the global economy all at once. See, it's really the combination of those two that has turned China into the workshop of the world in such short order. Without the roads and trains and bridges and airports to connect its factories to its ports, and without those ports to connect it to export markets around the world, it wouldn't have mattered nearly as much that China had so many people it could move from its farms to its factories. They'd be stuck in low-end manufacturing. But the fact that it has invested in this arsenal of infrastructure, and it has had an army of surplus workers to keep wages down — although that's starting to change — has been enough to get multinationals to move their entire supply chains to the Pearl River Delta, and then the rest of China for that matter.

This has been, to use a technical term, something of a train wreck for a lot of American manufacturing workers. Now, on the one hand, factory jobs had been falling as a fraction of the economy long before China began taking them. Between the mid-1960s and late-1990s, manufacturing employment mostly stayed stable around 17 million to 18 million jobs while overall employment more than doubled from 62 million to 130 million. Which is to say that automation was preceding just fast enough for us to be able to meet our increasing manufacturing needs without an increasing manufacturing workforce — just like in every other rich country. But, on the other hand, factory jobs did start shrinking faster as a share of the economy because they started shrinking in absolute terms after we granted China Permanent Normal Trading Relations (PNTR) status in 2000.

Why did that status matter so much? It doesn't seem like it should have when PNTR didn't actually make tariffs any lower on Chinese goods. All it did was make it so that already-low tariffs didn't have to be renewed every year, which they unfailingly were, but instead renewed automatically. That is, they became permanent. (That, of course, is what the “P” in PNTR stands for). But, as the Federal Reserve's Justin Pierce and Yale School of Management's Peter Schott show, this did make a big difference because it gave businesses the certainty they needed to feel comfortable spending the resources it took to move their factories from the United States to China. Which they did, particularly in industries where tariffs would have gone up the most in the absence of a deal being restruck each year.

This didn't just leave American factory workers behind, but the rest of their communities too. That, at least, is what economists David Autor of MIT, David Dorn of the University of Zurich, and Gordon Hanson of the University of California at San Diego found when they looked at how the parts of the country most exposed to Chinese competition fared in the decade afterward. The answer: not well. Their manufacturing employment fell “substantially” more than the rest of the country, and, for people without a college education, even slightly declined for nonmanufacturing jobs as well. Not to mention that wages for non-factory workers also took a hit. (It's worth pointing out that Gallup economist Jonathan Rothwell thinks this is all a statistical illusion, but Autor, Dorn and Hanson counter that that's the real illusion).

This is not what was supposed to happen. Economists try to play down this damage with antiseptic terms like “transition costs,” but the general gist is that while trade will hurt some people for a little while, it won't hurt them in the long run. They'll either go back to school to learn something new for a job, or they'll move to someplace new for a job. But however it happens, outsourcing shouldn't send people on a downward spiral for 10 years or more — except for the part where it's done exactly that.

This decade-long depression in factory towns is already a pretty big challenge to the economic orthodoxy that freer trade is always better trade. But an even bigger one is the idea that we haven't just lost manufacturing jobs, but jobs overall. That's another thing that isn't supposed to happen, but which Autor, Dorn and Hanson say actually has. Here, though, they're on much less solid ground. Why? Well, when another country sells us more than we buy from them, that means they have dollars they have to do something with. They can either invest them in U.S. real estate or in U.S. businesses or, say, in U.S. government bonds, but whatever the case, that money is coming back to the United States in some shape or form. That should push interest rates down — assuming they're not zero — and, in turn, create enough other jobs to offset the factory ones we've lost.

Although even that might not be quite as many manufacturing jobs as it seems. That's because, as economist Ildikó Magyari found, companies that shipped jobs to China often used some of their savings to hire more people for their remaining U.S. factories and offices. That might not have been much consolation to people whose outsourced jobs and out-of-luck communities effectively subsidized other jobs in other parts of the country, but it does complicate the narrative that trade with China has been an unmitigated disaster for factory workers. It has been for some of them (and their neighbors); others not so much.

Unfortunately for Trump, there isn't a 140-character takeaway here. Yes, trade with China really has devastated some of our manufacturing communities for far longer than we thought possible. And yes, some of China's trade practices really have been unfair, from the way it used to manipulate its currency down to subsidize exports to the way its state-backed companies still “digest” technology from foreign firms to discourage imports. But up until 2008, when interest rates got as low as they could go, there's no reason to believe that China was costing us jobs overall. Nor is there to think that it is now. Interest rates are back above zero, and China has not only stopped pushing its currency down but has also spent a trillion dollars propping it up.

There is good news and bad news here. The good news is that the China shock is mostly over, and something like it probably won't ever happen again. There just isn't any other country that has both China's size and infrastructure. But the bad news is that, even if it doesn't, trade can still be a whole lot worse for a whole lot more people than we thought. The fact is that we don't redistribute from trade's winners to its losers, and we don't do much else to help them either — even though they and their communities need more of it than we thought. Politicians like to wave their hands and talk about job retraining or relocation subsidies, and maybe those are the best we can do, but their track record isn't great. There aren't any easy answers.

Only scapegoats.