This past weekend, over 2,500 Mormons showed up en masse outside the Latter-day Saints headquarters in Salt Lake City, Utah, to submit their resignations to the church. They were protesting a new decree excluding wedded same-sex couples from the church and granting baptism to the children of gay couples only if the children disavow their parents. As one devout Mormon put it in expressing her disappointment with the policy: “I feel like we are going backward when I thought we were moving forward slowly.”

Her statement encapsulates the current paradox of religious extremism: How is it that as humanity as a whole seems to be evolving to be more inclusive and less dogmatic in general, certain religious strains are doubling in their extremism? It’s possible to conceive of kernels of extremism as intrinsic within particular faith traditions. But it’s also possible to understand the current rise of extremism as a reactionary backlash against the overall liberalization of faith.

“We live in a world where every single person is challenging everything, where every single person has a voice” Amanullah De Sondy told me. De Sondy is a senior lecturer in Contemporary Islam at University College Cork (Ireland) and author of The Crisis of Islamic Masculinities.

“The extremists want conformity and detest plurality and differences. Being different, being an individual who states that it is their individual relationship with the divine is a huge challenge to those who want the strict order of organizing society.”

Put another way, strict religious ideology requires strict conformity, and people aren’t confirming anymore.

Between 2007 and 2014 in the United States alone, the portion of the population that identified itself as Christian declined by 7.8 percent. During the same period, the percent who consider themselves Jewish, Muslim, Hindu or some other non-Christian faith increased by 1.2 percent—still not enough to keep pace with the overall population growth of 7.9 percent during the same period.

The most significant shift came from the increase in those who consider themselves atheist, agnostic, or otherwise unaffiliated (an overall increase of 6.7 percent). Within this shifting landscape, the United States reached its lowest level of religiosity since 1952 .

The phenomenon is similar in Europe. According to data culled by the Islam in Europe blog:

The number of church-goers has dropped steadily for decades, but now there [is] also a lot of space in mosques around Europe. Recent data from the extensive European Social Survey (ESS) show that the number of Muslim immigrants who regularly go to the mosque drops significantly after they've lived in their new homeland for some time.

So how is it that in the face of declining religiosity, we nonetheless find ourselves swept up in almost unprecedented magnitudes of religious struggle—from the brutality of Daesh (as ISIS hates being called) in Paris and throughout the Middle East, or the far less extreme yet still perpetual hostility of Christian fundamentalists toward the gay, lesbian, bisexual, and transgender community?

“The three major Abrahamic religions—Judaism, Christianity, and Islam—all have groups that espouse some type of eschatology, or belief about the end of time,” says Valerie C. Cooper, associate professor of Black Church Studies at the Duke Divinity School. “Among these groups, eschatological fears that the end times are near may be stoked by perceptions that the group is being persecuted.”

That sense of persecution can come from the fact of declining religiosity. Or, say, a war being launched against an entire religion—whether it’s the supposed “War on Christmas” or a kind of “War on Islam” that some on the far right call for.

In this context, it’s reasonable to interpret any surge in fundamentalism within a given denomination as a reactionary backlash to the overall trend of liberalization. In Islam, for instance, “Many believers continue to believe in God but not in the place of worship,” says De Sondy. “Even if they don’t go and tender a resignation letter, they attend the Mosque and listen but at some level have checked out and do something different outside.”

De Sondy cites as an example the increasing acceptance of lesbian, gay, bisexual, and transgender Muslims outside formal religious structures—akin to the demonstration made by rank and file Mormons. These shifting beliefs seriously challenge the orthodox structures and ideas of the faiths, says De Sondy.

And so, unable to propagate their narrow view through ideological cohesion alone, dogma resorts to force—in mild forms like pro-discrimination laws against LGBT people pushed by Christian extremists in the United States, or murderous forms like the brutality of Daesh, which is disproportionately used to punish other “unfaithful” Muslims.

In fact, like other fundamentalist religious groups in this era, Daesh is overreacting to a shifting global climate in which its ideas are increasingly marginalized. The trick to defeating Deash it to see for what it is—a desperate backlash by a declining ideology.