More recently, when anti-immigrant protesters — many of them baby boomers or older — began their wave of protest marches in 2015, most of the people in Germany and abroad were surprised. But the authoritarianism and the anger about foreigners had been there all along; as the protesters themselves said, the problem was no one listened. And no one provided hope.

Then, to compound the problem, the establishment, scared of this new political force, made accommodations to it — moving right on issues like immigration in an attempt to dampen the far right’s appeal. But that only made the far right seem more acceptable to the mainstream, while alienating younger voters .

The good news is that Germany is moving forward despite itself. So long excluded from politics, younger Germans are taking to the streets. According to the organizers of one recent mass demonstration in Berlin, called “#unteilbar” (“inseparable”), 250,000 people marched in favor of a more open society — a number that swamps even the largest far-right marches. Yet the establishment has stayed silent.

In recent elections in Bavaria, the Green Party was led by Katharina Schulze, 33, and Ludwig Hartmann, 40. In the past their youth alone would have been considered disqualifying. Instead, they were able to draw in enough disaffected young Bavarians to win 17.5 percent of the vote, up from 8.6 percent in 2013 — an astonishing total for a left-leaning party in such a conservative state.

Bavarian voters aren’t alone: Recent polls show that as many as 50 percent of Germans can at least imagine voting for the Green Party, particularly because of its progressive position on migration and diversity.

Put differently, the real challenge in Germany is not so much the left-right divide as it is a generational split. The older generations, reared on consensus, are not used to open public debate, let alone diversity. But the younger ones are opting for a new social order that includes people of other ethnic backgrounds and sexual orientations. They do not fear immigrants as much as they fear the fact that they can’t afford housing or taking care of their parents once they get old.

Younger generations have always had different needs from their elders, but in the past the establishment has found ways to meet those needs without ceding power. That’s no longer acceptable to young Germans. They don’t just demand a more equitable, open society. They want to shape it. If Germany’s establishment resists them, it will set the country on the path to years of social turmoil.

Jagoda Marinic (@jagodamarinic), an essayist and novelist, is the author, most recently, of “Made in Germany.”

Follow The New York Times Opinion section on Facebook, Twitter (@NYTopinion) and Instagram.