Almost all the pillars of President Trump's presidency — immigration, jobs, mistrust of allies, coloring Washington as a feckless, greedy swamp — can be traced back to one of his core beliefs: America is getting shafted by the rest of the world.

The president has hinted or outright said as much in nearly every major international speech he's given since becoming president, including Tuesday's remarks at the United Nations: “I will always put America first just like you, the leaders of your countries, should put your countries first,” he said.

On the campaign trail, he tied nearly every one of his core issues to his “America first” doctrine, which is based on the idea that America is struggling at the hands of the rest of the world.

On immigrants crossing the U.S.-Mexico border: “When Mexico sends its people, they're not sending their best. They're not sending you. They're not sending you. They're sending people that have lots of problems, and they're bringing those problems with us. They're bringing drugs. They're bringing crime. They're rapists. And some, I assume, are good people.” June 2015 presidential announcement 

On U.S. jobs: “They’re not good jobs, they’re bad jobs. We’re losing, you know, when you see a Carrier move into Mexico, those are good jobs. We’re losing the good jobs.” March 2016 interview with New York Times' Maggie Haberman and David Sanger

On trade: “We don't put America first. We have these horrible, horrible trade negotiators. I actually think they're not as stupid as people think. I think that they actually want to help everybody else. They want to help everybody but our country. We are going to have a policy of America first. Make America great again.” — June 2016 speech in Redding, Calif.

On politicians: “We are going to put America first, and we are going to make America great again. This election will decide whether we are ruled by the people, or by the politicians.” — March 2016 speech to the American Israel Public Affairs Committee

On engagement abroad: “We have been disrespected, mocked and ripped off for many many years by people that were smarter, shrewder, tougher. We were the big bully, but we were not smartly led. And we were the big bully who was — the big stupid bully and we were systematically ripped off by everybody.” — March 2016 New York Times interview

Fact checkers and mainstream economists disagree with many of the statistics Trump used to shape this view of the world. Trade deficits are not the best way to measure how fair trade is. NATO members are not paying too little as compared with the United States. Trump had to delegitimize official U.S. job numbers as “phony” to try to make his case that the U.S. economy is in turmoil.

But fact checking the president raises another question we have to explore to understand why the insular brand of “America first” has become the foundation of Trump's presidency: Why would he sell a worldview that the facts don't support? Especially when the rest of the international order is going in the opposite direction, operating under a shared belief that opening borders and cooperation is the best way to protect each country's own national interests.

Trump bragged to the New York Times in that March 2016 interview that he thought the United States has been on the wrong track since at least the World War II era. So perhaps this has always been his worldview, and he hasn't bothered to update it with the realities of globalization.

But the message that the United States isn't working is also an odd one coming from a successful businessman who has made billions in this country and others.

It is, however, a convenient worldview if you want to win a presidential campaign against more experienced candidates. If you can convince enough voters that the United States has been on the wrong track as long as the politicians have been in charge, you have a shot at winning. And that's exactly what Trump did: blamed politicians for letting the rest of the world steamroll the United States, promised to reverse course and won the presidency against all odds.

That's why it's important to note that Trump's “America first” doctrine can't easily be separated from another defining theme of his campaign: that the world is a dark, dark place, and no country is struggling more right now than the United States.

In his inauguration speech, he described the nation he was about to inherit as “American carnage.”

“Mothers and children trapped in poverty in our inner cities; rusted out factories scattered like tombstones across the landscape of our nation; an education system flush with cash, but which leaves our young and beautiful students deprived of all knowledge; and the crime and the gangs and the drugs that have stolen too many lives and robbed our country of so much unrealized potential.”

U.S. politicians have let the world take advantage of America, which is now literally in carnage. It's on those two core beliefs that Trump built nearly every pillar of his campaign and his presidency.

Much of it doesn't comport with the facts, but it sure was an effective message to win the presidency.