Donald Trump does not, so far, seem to be enjoying the presidency very much. Newly sworn in and still shining from victory, the commander-in-chief spent his first week in office lumbering bitterly from grievance to grievance, even before his travel ban started to unravel over the weekend—carping about media coverage, quibbling over TV ratings, spiraling into obsession about the size of his inauguration crowd.

The spectacle mystified even some of the savviest political observers. As one former Obama White House official put it to me, “You just won the biggest trophy in the world—who cares how many people were standing there to watch you get it?”

But the president’s behavior begins to make more sense once you understand the stories he’s long told himself—about his roots, his rise, and, especially, his “haters.” That he is easily provoked and perpetually aggrieved is not a revelation, of course. But Trump harbors a very specific kind of class anxiety that’s rooted in the topography of his native New York City.

Though he was born into a wealthy family, partaking of the various perks and privileges afforded to millionaires’ offspring, Trump grew up in Queens—a pleasant but unfashionable borough whose residents were sometimes dismissed by snooty Manhattanites as “bridge-and-tunnel people.” From a young age, he was acutely aware of the cultural, and physical, chasm that separated himself from the city’s aristocracy. In several interviews and speeches over the years, he has recalled gazing anxiously across the East River toward Manhattan, desperate to make a name for himself among the New York elite.

“I started off in a small office with my father in Brooklyn and Queens,” Trump said in his 2015 campaign kickoff speech.  “And my father said … ‘Donald, don’t go into Manhattan. That’s the big leagues. We don’t know anything about that. Don’t do it.’ I said, ‘I gotta go into Manhattan. I gotta build those big buildings. I gotta do it, Dad. I’ve gotta do it.’”

In Trump’s version of the story, he eventually achieved his dream by crossing the river, conquering the island, and triumphantly erecting an eponymous skyscraper in the middle of town as a monument to his greatness.

In truth, though, the city’s ruling class never did warm to his arrival, and they greeted every one of his ensuing accomplishments with a collective sneer. To them, it didn’t matter how many buildings he built, or books he sold, or tabloid covers he appeared on—Trump was a vulgar self-promoter, a new-money rube, a walking assault on good taste and manners.  He was, in short, not one of them. And he knew it.

Norman Podhoretz wrote in 1967, “One of the longest journeys in the world is the journey from Brooklyn to Manhattan.” In many ways, Trump still seems like he’s on that journey—convinced that there’s some destination he can reach, some victory he can achieve, that will finally silence the din of elite ridicule and win him entry into their ranks. It is when this fantasy collides most violently with reality that he tends to lash out.

Trump’s political rise is instructive here. When he first began teasing the possibility of a 2016 presidential bid, the chorus of scorn from the political class was deafening. (I would know.) Former aides have told me that his decision to run was motivated largely by a desire to prove his sophisticated skeptics wrong. But even as his campaign took off, the respect he craved never materialized—and the further he got, the hotter his resentment seemed to burn.

Indeed, some of his biggest wins on the campaign trail were followed immediately by angry tantrums and disgruntled outbursts.

After formally accepting his party’s presidential nomination last July, for example, he embarked on a bizarre grievance-airing campaign swing, during which he complained incessantly about the unfair attacks being leveled at him from the Democratic convention stage. At one stop, Trump told his crowd, “I was going to hit a number of those speakers so hard their heads would spin.” At another, he grumbled that Hillary Clinton had not adequately congratulated him for “having done something that nobody has ever done in the history of politics in this nation.” Despite pleas and protests from his advisers, he pursued an impossible-to-win feud with Muslim Gold Star parents who had criticized his grasp of the Constitution. The newly minted nominee became so belligerent and erratic that party leaders were reportedly plotting an “intervention.”

This pattern of behavior repeated itself in the wake of Trump’s stunning November victory. Rather than adopt the sort of magnanimous, above-the-fray pose available to people who have just been elected leader of the free world, Trump descended into defensiveness and paranoia. He grew obsessed with his loss of the popular vote, and concocted an outlandish voter-fraud conspiracy theory to explain it away. When a congressman questioned his legitimacy, Trump torched him on Twitter; when a movie star questioned his decency, he fired back in the press. And if all this sore-loser pettiness seemed unbecoming of a president-elect, Trump made clear that he wouldn’t be shedding it in the White House.

Last week, the Washington Post reported that Trump was so infuriated by comparisons between the size of his inauguration crowd and that of Barack Obama’s in 2009 that he personally phoned the National Park Service director and ordered him to produce photos showing attendance at his swearing-in was superior. The story went viral not because it was especially important, but because it was so strange. How could someone ascend to the most powerful office in the world, only to be set off immediately by something as small and silly as crowd size?

But for Trump, it wasn’t really about inauguration attendance, or even popularity per se. It was about finally gaining access to the most exclusive fraternity in the world, and realizing he was still consumed with fear that he didn’t belong.