German Chancellor Angela Merkel has a selfie taken with a refugee during a visit to a refugee reception center in Berlin in September 2015. (European Pressphoto Agency)

At the height of the refugee crisis two years ago, many Germans thought that Angela Merkel’s days as chancellor were numbered. Merkel’s open embrace of Syrian refugees upset the conservative wing of her own Christian Democratic Union (CDU) and fired up the far-right, anti-Muslim Alternative for Germany (AfD).

Fast forward to Sept. 24, 2017, and the CDU lost millions of votes. But it remains Germany’s largest party, with Merkel at the head. The election campaign was widely characterized as boring, in part because her center-right CDU and the center-left Social Democratic Party (SPD) largely agree on how to approach the immigration issue.

But this bipartisan centrist consensus alienated many voters and helped the AfD secure 12.6 percent of the vote. The AfD is now the third-largest party (behind the CDU and the SPD) and is sending over 90 politicians to the Bundestag.

How much do issues related to refugees, immigration and Islam matter in German politics?

Though significant in a country that has long kept far-right parties at bay, this outcome doesn’t actually tell us much about the status of immigrant integration in Germany today — or about the future role of Germany’s Muslims in politics.

That’s because parties in Germany are just starting to grapple with the inclusion dilemmas that arise when parties incorporate Muslim voters in their coalitions. According to recent estimates, 1.5 million eligible German voters are Muslim, representing 2.5 percent of the electorate.

Electoral inclusion may run counter to social inclusion

A long-held view claims that political incorporation goes hand in hand with social inclusion: As immigrants begin helping major parties win, they also integrate into society. But there are reasons to think that this development is not afoot in Germany or in Western Europe more generally.

In my recent book, “Dilemmas of Inclusion: Muslims in European Politics,” I find that the electoral recruitment of Muslims can be counterproductive to their social inclusion. This doesn’t just reflect hateful campaigns by populist, anti-immigrant parties. Instead, mainstream political parties deserve much of the blame for this outcome.

Here’s the problem. The political inclusion of Muslims presents European parties with sharp tradeoffs, because Muslims are one of the most stigmatized groups in Western Europe. If parties overtly court Muslim votes, they risk incurring a nativist backlash. And while European Muslims are diverse in origin and outlook, they tend to be more religious, socially conservative and supportive of patriarchal values than the average voter — and much more so than the typical progressive, cosmopolitan voter.

In other words, voters who typically embrace diversity may have qualms about voting for conservative Muslims.

This value clash is particularly severe in Europe’s cities. Here, Muslim voters reside in enclaves that are especially conservative, and they live alongside progressives hipsters who are decidedly less so. But the Muslim vote in cities is sizable — and can swing elections. Failure to capture a large slice of the Pakistani vote in Birmingham, England, or the Moroccan vote in Brussels, can spell electoral defeat.

There’s a clash of votes vs. values

How, then, do parties resolve these inclusion dilemmas? To answer this question, I collected information on thousands of local elections in Austria, Belgium, Germany and the United Kingdom. I analyzed where and when parties included Muslim candidates on the ticket, and I studied the types of appeals that Muslim candidates use to recruit Muslim voters.

My book demonstrates that parties of all ideological stripes ignore the value conflicts that Muslim inclusion can present once they figure that securing seats requires them to win over substantial shares of the Muslim electorate.

What’s more, rather than trying to build coalitions across groups — for example, stressing a Muslim candidate’s shared working-class interests — they elevate Muslims’ ethnoreligious distinctiveness. That’s because tapping into ethnoreligious networks yields hefty electoral returns.

Typically, parties liaise with self-appointed conservative community leaders or religious figures who promise to deliver the enclave vote en bloc. Ties based on kinship, home-village loyalties and religion — not policy preferences — sustain the bloc vote. Mosques serve as convenient campaign venues, and election events are frequently segregated by gender.

Indeed, my research finds that when parties rely on the Muslim vote to win elections, the representation of women suffers. This is also true for leftist parties who have made gender equality a major plank of their platforms and who have instituted rules that promote the rise of women within their ranks.

But if the choice is between winning elections or between advancing gender equality, parties choose the former. Muslim candidates who are embedded in the enclave and who can bring out the vote are almost always men.

Though the position of women within Muslim communities represents a central flash point in debates about Muslim integration, political inclusion is not likely to change gender hierarchies in women’s favor.

This leaves political integration without social integration

Parties’ engagement with Muslim voters and candidates also magnifies perceptions of cultural divides. Muslims and non-Muslims often lead separate social lives. As a result, to non-Muslims, visible political candidates represent Muslims as a whole, even if they tend to reflect communities that are more religious and conservative than the average European Muslim.

Simply counting the number of Muslim public figures such as politicians can therefore be a misleading indicator of Muslims’ collective integration and assimilation.

Why don’t parties pick more assimilated candidates and Muslim women? In fact, they also pursue this strategy. But my research shows that they only do so when they want to present themselves as cosmopolitan to non-Muslim voters. If the goal is to recruit the Muslim enclave vote, these considerations are secondary, and political inclusion can run counter to social integration.

In European countries where Muslims have been voting citizens for some time, like the United Kingdom, the Netherlands or France, these conflicts between values and votes have divided local parties. In Germany, where large-scale citizenship acquisition has been more recent, parties are now starting to contend with the problems posed by Muslim inclusion.

So Merkel certainly has much to celebrate. But Sunday’s German election might have been the last one in which parties were able to skirt these difficult political and social dilemmas.

Rafaela Dancygier is associate professor of politics and public affairs at Princeton University. She is the author of numerous articles on immigration and immigrant integration and has written two books on the topic, “Immigration and Conflict in Europe (2010) and “Dilemmas of Inclusion: Muslims in European Politics(2017).