In European Parliament elections this month, voters in most of the European Union’s 27 countries rallied to parties that hold the union in contempt. Analysts have leaped to the conclusion that the European Union must have done something wrong.

It didn’t. The specific policy grievances that drove the election results were national, not continental. In France, where the once-taboo National Rally party outpolled the party of President Emmanuel Macron by more than 2 to 1, voters were angry about the president’s immigration policy and the snootiness with which he formulated it. In Germany, where a hard-right party anchored in the formerly Communist East got more votes than any of the three governing parties, voters cited highhanded energy policies.

Such local complaints, to be sure, occasionally echo frustrations with corresponding E.U. policies on immigration and energy. But the European Union’s governing machinery in Brussels is never where voters’ hearts and hopes are. Indeed, that is the real problem with the union: not what it does but what it is.

Founded in the wake of the Cold War to meld Europe’s nation-states into an “ever closer union” and to form a continental government that would practice a new kind of politics, the European Union has wound up more outdated than the nation-states it was meant to supplant. Imposing common rules and laws on nations that had for decades or centuries viewed lawmaking as their own democratic business was harder than it seemed. The union is looking more and more like one of those 19th- and 20th-century projects to universalize the un-universalizable, like Esperanto.

The Maastricht Treaty, the 1992 agreement about currency, citizenship and freedom of movement on which the present European Union is built, was drafted for a world that was disappearing. Back then, only a handful of richer countries — France, Germany, Britain, and the Netherlands among them — had significant immigration, and already majorities were unhappy with it. These countries were industrial powerhouses, with economies structured to favor workers and benefits that were envied around the world. They had big militaries, which they no longer seemed to need now that the Cold War was over.

One way to look at the E.U. project, in fact, was as a codification of the values that had won the Cold War. That “values” win wars is a bold assertion, but back then, the West was in a self-confident mood. The Luxembourg prime minister (and later, European Commission president) Jean-Claude Juncker was soon crediting European integration with having brought “50 years of peace,” even though the European Union had not yet been founded when the Berlin Wall fell. A more sober analysis would credit that peace to American occupation, NATO vigilance and Russian caution.