I don't think people pay enough attention to how nationalism relates to self-esteem. Why, for example, are people so keen to "make America great again"?
The answer is that, for most of human history, we achieved deep meaning by a connection with an ancestral people. Our tribe, kin, and clan. These relations gave us a history and roots.
But with the rise of the modern nation state, especially with such a rootless nation of immigrants like America, our identities have become increasingly associated less with a tribe than a state, a flag, a country. I am who I am--I matter, I have worth--because I'm an American. The status of the nation, its heroic narrative, confers status on its citizens. And if you don't have a lot going for you in life, you can cling to that, you can raise the flag. No one can demean or shame you, because you're a f***ing American.
By and large, Republicans get this dynamic more than Democrats. Donald Trump, especially, knew this. Without deep meaning Americans achieve self-esteem via the status of the nation. You elevate the stature of the nation and you elevate the worth, value, and dignity of its citizens. Make America great and you make its people great. There is a primal pull here, rooted deep in the limbic system. It's not abstract, but a raw, visceral ground of dignity.
The point here is that you can't really understand political discourse without understanding the connection between nationalism and self-esteem. To be sure, this doesn't explain everything within the political landscape. For example, what about Democrats and self-esteem? (I'd argue that they are pursuing self-esteem through performative social justice activism where they cultivate a feeling of moral and intellectual superiority.) Still, if you can't see how people desire to take pride in their country, and why this thirst exists, you're not going to understand what is happening in America.