If you want to understand what Islamist militancy today is really about, pay attention to this statement by the Taliban’s spokesman last week: “China is our most important partner, and represents a fundamental and extraordinary opportunity for us.”

Let me remind you that China is credibly accused of massive and pervasive persecution of its Muslim population — including mass incarceration, systematic “reeducation,” 24/7 surveillance and, in some cases, forced sterilization. In other words, the world’s most ideologically committed Islamist government has said that its closest ally will be a nation engaged in what many observers call cultural genocide against Muslims. Lesson: The Islamist militant movement has always been more about power than about religion.

Twenty years after 9/11, we are still not clear on how to think about radical Islam. It is real, it is evil, but over the past two decades, it has lost the ideological argument. The real clash of civilizations was never between the West and Islam. It was within the world of Islam, between the existing regimes and their Islamist opposition movements, and more broadly between moderates and radical religious groups.

Recall Osama bin Laden’s original fatwa of 1996. In it, he explained that the reason to go after the “far enemy,” the United States, was that it supported governments such as Egypt and Saudi Arabia, which were the “near enemy” and the true focus of bin Laden’s strategy. The goal was to sweep out dictators, which would then bring Islamist movements to power that would rule the Muslim world like the caliphate of old.

But bin Laden’s strategy was based on a fantasy — specifically, that hundreds of millions of Muslims were pining for sharia rule, and that their dislike of dictators such as Saddam Hussein and Hafez al-Assad translated into support for the mullahs who opposed their regimes. In fact, while much of the Arab world was ruled by unpopular tyrants, what their people really wanted, it turned out, was greater openness, more democracy and an accommodation with modern life, not a rejection of it. We saw this in the massive demonstrations of 2011 that came to be known as the Arab Spring. We have seen it in many elections in the Muslim world, in Iraq, Tunisia, Turkey, Pakistan, Indonesia and Malaysia. Even when Islamist parties have won, they tend to be the ones that work within the democratic framework, are reasonably moderate and have rarely advocated strict sharia.

Public opinion polls have long established this trend. In 2009, the scholar Fawaz Gerges found that polls conducted in dozens of Muslim countries showed the same — a collapse of support for Islamist militancy and terrorism. He pointed out that just 29 percent of Jordanians thought suicide attacks were “often or sometimes justified,” down from 57 percent in 2005. In Indonesia, 74 percent agreed that terrorist attacks are “never justified,” up from 41 percent in 2004. Even in Pakistan, nearly 90 percent opposed any terrorism, up from 43 percent in 2002. (To give these numbers some context, Gerges noted that 24 percent of Americans believed “bombing and other attacks intentionally aimed at civilians” were "often or sometimes justified.” Only 46 percent said these kinds of attacks were never justified.) Subsequent Pew Research Center surveys have confirmed this broad aversion to Islamist militancy.

Consider the changing role of some nondemocratic Muslim countries — Saudi Arabia and other Gulf states. For decades before 9/11, Saudi Arabia had been the ideological, political and financial heart of Islamist fundamentalism. It had exported mullahs, money, mosques and madrassas across the Muslim world, all imbued with an intolerant and puritanical brand of Islam. Then came 9/11 and, more importantly for the Saudis, the terrorist attacks of 2003 and 2004 in Saudi Arabia itself. Soon the monarchy began changing course, a process that David Petraeus described to me as “one of the most important, least reported positive developments in the war on terror.” That development has continued. Even though he has cracked down hard on dissent and opposition, the Saudi crown prince has also opened up Saudi society to foreign cultural and educational influences, weakened the power of the dreaded religious police and expanded women’s rights significantly.

In 2001, the United Arab Emirates was, along with Saudi Arabia and Pakistan, one of the only three governments on the planet to recognize the Taliban government in Afghanistan. Today, the UAE has not yet recognized the Taliban, but it has established diplomatic relations with Israel and is building stronger economic and social ties with that country — without facing great fallout in the Muslim world. Gulf cities such as Abu Dhabi, Dubai and Doha are open, diverse and modern by comparison with most places in the Middle East and even many in Asia. These are all absolute monarchies, of course, but the fact that they have stopped pandering to fundamentalists and are now openly embracing Western and modern values is telling.

It is not surprising that the Taliban is seeking out China as its most important partner. My bet is that it will have a much harder time finding easy allies in the Muslim world.

Watch the latest Opinions short film:

Conspiracy theories blaming George W. Bush for the Sept. 11, 2001, terrorist attacks have been debunked, yet millions of Americans still believe them. (Kate Woodsome, David Byler/The Washington Post)