The Fourth of July, for me, is one of those special American holidays that celebrates not religion, ethnicity or sect but rather freedom and the country’s unique national identity, which is based on it. But around the world these days, we’re seeing the rise of another kind of nationalism, one that can be darker and more troubling.

In the recent elections for the European Parliament, nationalist, populist and even xenophobic parties did extremely well. The U.K. Independence Party defeated all of the established parties. France’s National Front won handily against the ruling Socialist Party. In Greece, the quasi-fascist Golden Dawn won half a million votes, giving it seats in the European Parliament for the first time.

Many commentators have explained the rise of these parties as a consequence of the deep recession and slow recovery that still afflict much of Europe. But similar voting patterns can be seen in Austria, Denmark, the Netherlands, Finland and Sweden, which are thriving economically. And the parties that do well center their agendas not on economics but on immigration and other expressions of nationalism.

You can see this rise of nationalism not just in Europe but also around the world. Consider Japanese Prime Minister Shinzo Abe’s plan to reinterpret his country’s pacifist constitution. Leaders such as Vladimir Putin in Russia, Recep Tayyip Erdogan in Turkey and Xi Jinping in China have made appeals to nationalism a core part of their agenda and appeal.

There is, of course, a healthy nationalism that has often been part of the expansion of liberty and democracy. Britons and Americans take pride that their countries embody values they hold dear. Poles and now Ukrainians take pride in their struggles for independence and success. But today we seem to be witnessing mostly a different kind of nationalism, based on fear, insecurity and anxiety. And, as the philosopher Isaiah Berlin has noted, like a bent twig, this kind of nationalism always springs back with a vengeance.

The Star-Spangled Banner. (National Museum of American History/National Museum of American History)

Why is this happening now? One explanation is that as globalization and technological revolutions race ahead and transform the world, people feel uneasy with the pace of change and search for something to hold on to for succor and stability. If the bond is strongest at the level of the nation, nationalism surges. But if the national project is fragile or viewed as illegitimate, then you see the pull of older, deeper forces. From Catalonia to Scotland to the Middle East, subnational identities have taken on new meaning and urgency.

It is a strange mixture of insecurity and assertiveness. People worry that their society is changing beyond recognition and that they are being ruled by vast, distant forces — the European Union in Brussels, the International Monetary Fund or the federal government in Washington — that are beyond their control. And by people who do not share their values.

In the United States, we do see one parallel: the rise of the tea party. Scholars Vanessa Williamson and Theda Skocpol concluded that immigration is a central issue — perhaps the central issue — for tea party members, something that has been reinforced by House Majority Leader Eric Cantor’s loss in his primary election in Virginia. I don’t recognize my country anymore, say Mike Huckabee, Glenn Beck and many others on the right. The same line could be repeated by every one of those European nationalists who won in the polls in May.

In an age of globalization, elites have discussions about political ideology — more government, less government — but, as Samuel Huntington noted many years ago, the bottom-up force that seems to be moving the world these days is political identity. The questions that fill people with emotion are “Who are we?” and, more ominously, “Who are we not?”

Even in America, even on the Fourth of July.

Read more from Fareed Zakaria’s archive, follow him on Twitter or subscribe to his updates on Facebook.