The way these leaders practice democracy, bending the rule of law as far as they can within an elected government, is equally unsettling to the older democracies of Western Europe. Another French political scientist, the Czech-born Jacques Rupnik, has identified two converging trends.

“We are witnessing a democratic regression and identity-related tensions on migration, and both phenomena are strengthening each other,” he told me. “The same nationalist conservative authoritarianism at work in domestic politics also applies to the response to the refugee crisis, notably different from the European Commission’s and most other member states’ responses.”

Once the poster children of post-Communist transition, these countries were not supposed to take such a turn. With its so-called goulash socialism, Hungary was the most liberal of the Soviet satellites and eased peacefully into democratic rule. Poland was more restless, but once it had been the catalyst for the collapse of Communism, it managed the shock therapy of moving to a market economy with impressive discipline. The Czechs and Slovaks, it was hoped, would behave as Mr. Havel’s enlightened heirs.

But no Communist country had ever experienced these radical shifts to democracy and market economics. Only Czechoslovakia had enjoyed genuine democratic rule, between the two world wars. The end of the Cold War made Europeans euphoric: Once democratic institutions were built, free elections held and centralized economies replaced with capitalist ones, everyone assumed the job was done.

Joining NATO and the European Union was the icing on the cake. In 2008, with “end of history” hubris, a World Bank report proclaimed that the transition was over. Mission accomplished.

Obviously, it was not. The effort to transform the economy was so demanding for the new democratic elites that little attention was paid to nurturing a new political culture. Modern Hungarian and Polish politics look riven with the legacy of Communism, trouble with sharing power, conspiracy theories and exclusionary discourse toward opponents.

Another, overlooked, factor is that most people in these countries are still poor. Despite nonstop economic growth since 1992, Poland’s gross domestic product is only 68 percent of the European Union’s per capita average. When Poland’s foreign minister, Witold Waszczykowski, says the world should not move in one single direction — “toward a new mix of cultures and races, a world of cyclists and vegetarians” — he is rejecting the progressive social values perceived as part of the Western European economic model.