Trump has been trained since childhood to ignore reality when things don't go his way. His family attended Norman Vincent Peale's church in New York, which preached "The Power of Positive Thinking." It was an offshoot of the New Thought mental health cult that formed in the 1870s.
Literature from the New Thought cult says, "Our mental states are carried forward into manifestation and become our experience in daily living." In other words, thinking something makes it so. And that's why whenever Trump loses, he thinks he really won and someone conspired against him to make it look like he lost.
It's worth watching this video clip from the 2016 Presidential debate between Hillary Clinton and Trump because Clinton describes perfectly Trump's delusional outlook.
Here's what she said:
You know, every time Donald thinks things are not going in his direction he claims, whatever it is, is rigged against him. The FBI conducted a year-long investigation into my emails, they concluded there was no case. He said the FBI was rigged. He lost the Iowa caucus, he lost the Wisconsin primary. He said the Republican primary was rigged against him. Then Trump University gets sued for fraud and racketeering. He claims the court system and the federal judge is rigged against him. There was even a time when he didn't get an Emmy for his TV program three years in a row and he started tweeting that the Emmys were rigged. This is a mindset. This is how Donald thinks. And it's funny, but it's also really troubling. That is not the way our democracy works. We've been around for 240 years, we've had free and fair elections, we've accepted the outcomes when we may not have liked them. And that is what must be expected of anyone standing on a debate stage during a general election. You know, President Obama said the other day, "when you're whining, it just shows you're not up to doing the job." And let's be clear about what he is saying and what that means. He is denigrating, he's talking down our democracy, and I for one am appalled that somebody who is the nominee of one of our two major parties would take that kind of position.