The impetus to found the Center for Strategic Counterterrorism Communications (CSCC), the State Department division charged with countering jihadist propaganda, had come in 2010 from Secretary of State Hillary Clinton, who was keen from the outset of her tenure to come to grips with power of the Internet.

She was especially determined to do something to counter the growing online presence of al-Qaeda and other jihadist groups. But it was not until September 2011 that President Barack Obama signed White House Executive Order 13584, and CSCC was officially established.

Now, in 2014, CSCC was battling international headlines externally, but internally they were struggling with the problem at the heart of 21st century warfare: who wins the battle of narratives. The team was countermessaging online, trying to subvert Islamic State’s propagandist narrative by punching holes in it and by pointing to its hypocrisy and inconsistencies. But what it was failing to do was offer an equally powerful counternarrative in response.

This problem existed for two reasons: one more immediate and, while initially overwhelming, theoretically manageable, the other far broader and almost impossible to counter.

The first problem was that Islamic State gained global infamy on the back of a series of startling military successes on the ground. Propaganda does not exist as a Platonic essence. It must have some basis in reality. Sometimes the relation is so tenuous as to be absurd, as with Moscow’s labeling of Ukraine’s government as a “fascist junta.” But sometimes it is strong. And the fact was that in 2013 Islamic State had conquered the Syrian city of Raqqa, which had a population of a million people—the first time in modern history an al-Qaeda-like group had gained unfettered control of an urban area. Just over a year later, it took Mosul, the second-largest city in Iraq. These successes allowed the group to push a triumphalist narrative online, with plenty of videos and images to back it up, giving it an almost unstoppable momentum.

CSCC’s Digital Outreach Team (DOT), conversely, could say little by way of response. Unlike Russia, it couldn’t deny or reinvent reality. It could continue to highlight the group’s atrocities against fellow Muslims, but it could not rebut the online gloating of Islamic State fanboys.

As CSCC’s head at the time, Alberto Fernandez told me: “ISIS propaganda was always sophisticated and highly polished, but the reason we saw it take off in June 2014 was because it was tethered to extraordinary events on the ground. ISIS takes a third of Iraq and takes Mosul and seems to be unstoppable wherever it goes—and we were supposed to counter that with words and videos? We were essentially called upon to make bricks with straw. It was ridiculous.”

What Mosul also showed was that the amplification and global dissemination of Islamic State’s victories were just as important as the victories themselves. In the months following Mosul’s fall, recruitment soared. But because this problem is tethered to events on the ground, it is ultimately manageable. What exists on the ground can be defeated on the ground. And so it proved.

Since the heady days of mid-2014, Islamic State has suffered a series of defeats that have seen it lose just about all of the territory it once occupied. In spring and summer 2017, the Iraqi security forces backed by US airstrikes and Kurdish forces advanced on Mosul, eventually retaking the city. Recently, Islamic State’s stronghold in the Syrian city of Raqqa fell. It is all but finished on the ground in the Middle East. As a result, Islamic State’s “victory narrative” has long since receded.

But the group’s propaganda remains (albeit not at 2014 levels). This fact points to a recurrent theme also at the heart of 21st-century war: that the military dimension, what happens on the physical battlefield, no longer stands alone as the most important arena of conflict.

From Ukraine to Gaza to Iraq and Syria, it is clear that the physical and virtual battlefields directly impact each other to such a degree that they now blur together. And this is how Islamic State understands war. As Bari Atwan, author of Islamic State: The Digital Caliphate points out, in its heyday the group used its online propaganda to terrorize the enemy and to coerce local populations. Its ability to produce large amounts of military propaganda from the field as it once did has receded. But rather than see its online presence wither and die, the group has merely shifted its focus.

Islamic State expert Charlie Winter notes that the group’s recent propaganda has had a distinctly nostalgic tone. “The caliphate will continue to exist no matter what happens on the ground,” he told me. “But it will live on more as a virtual myth than anything else. They have huge archives of video material, which now focuses on the way bureaucracy works and the civilian side of life in the caliphate, so they can say in a few years’ time, ‘This is what it was like.’ If and when they lose more territory, they can point their supporters to this virtual living archive of their past exploits.”

Islamic State will continue to lose militarily, but the physical battlefield is no longer the single most important arena of warfare. The group and its virtual caliphate will live on.

The second problem CSCC faced in countering Islamic State’s narrative was less about being able to refute the group’s narrative of success than about not being able to offer an equally powerful counternarrative in response.

One of its most prominent anti-Islamic State campaigns “Think Again, Turn Away,” as the name implies, was a negative narrative, calling on people—especially the young and disenfranchised yearning for meaning in their lives—not to do something.

Set against that was the multifaceted nature of Islamic State’s propaganda, which pushed highly stylized ultraviolence designed to appeal to the young and frustrated, offering them a chance to take part in that most dramatic of pursuits: war. And they did so in the most professional of ways, mimicking the cultural tropes and styles of Western culture.

Think tank researchers Emerson T. Brooking and P. W. Singer cite the work of Javier Lesaca, a visiting scholar at George Washington University’s School of Media and Public Affairs, who studied 1,300 Islamic State propaganda videos. He discovered that 20 percent were directly inspired by Western entertainment, including popular video games like Call of Duty and Grand Theft Auto as well as Hollywood movies like American Sniper.

Alongside this was the positive vision of the caliphate.

Just as the group pushed Hollywood-style ultraviolence, it also pushed its state-building narrative. Videos like “Eid Greetings from the Land of the Khalifah,” which showed children handing out sweets in a mosque, displayed the “softer” side of the caliphate

Prominent in pushing this narrative are videos from the “Mujatweets from the Islamic State” series, which feature scenes ranging from an armed fighter visiting the sick in an Islamic State hospital to a tour around the Raqqa market that highlights the produce on display, up close and in vibrant colors. All of it is designed to appeal to the positive emotions in people, the yearning to be a part of something greater than themselves, and the desire to help their fellow Muslims. Come to Syria and be a hero, or stay in Paris and drive a cab.

As Fernandez told me bluntly: “We spent our time telling people not to do things. ISIS, meanwhile, told them to take control of their lives, to join them and take action. There was only ever going to be one winner.”

Indeed, there was.

Eventually the State Department decided to get out of the direct messaging business altogether, and in 2016 CSCC was shut down.

Integral to CSCC’s failure was the fact that Islamic State’s narrative dovetails perfectly with the 21st-century millennial zeitgeist. Today’s twentysomethings have come of age in the aftermath of the 2008 Great Recession: job prospects are bleak, and the future is uncertain. The turn of the century has also seen a loss of faith in the great institutions of the West, from politicians to the financial sector to the press.

Melanie Smith, project coordinator at the Institute of Strategic Dialogue, a key center of the United Kingdom’s counterextremism efforts, and herself in her twenties, told me, “There is a loss of trust in authority in my generation and widespread hysteria around being a millennial. You’re constantly told you won’t be able to do what you want or find suitable work. If I look at my friends, some [with no prospect of finding decent work] have gone off traveling for three years, while others are working in orphanages and things like that.”

Within this general miasma, demagogues and countercultural movements of all stripes now flourish. Both Islamic State and Russian propaganda, as well as the alt-left and the alt-right, with their elements of anti-Semitism and Islamophobia, take advantage of this climate. America’s president, Donald Trump, is the figure around which the alt-right has gathered. He has helped to mainstream their extremist ideology. Jeremy Corbyn, a figure from the hard left, leads Britain’s main opposition party.

Rebellion against the establishment “elites” that have led the West for centuries is erupting in Europe and North America. This has coincided perfectly with the emergence of social media, which have flattened the media space and given these various extremist actors greater ability to project power and to subvert Western institutions than ever before.

Social media have helped to dismantle traditional information and media hierarchies, and in so doing have given birth to a new type of hyperempowered individual, networked, globally connected, and more potent than ever before: a uniquely 21st-century phenomenon I term Homo digitalis. And Homo digitalis, like social media, is a force for both good and ill, a revolutionary force that can challenge government narratives and political figures from Washington to London. In this sense, Islamic State is only one part of a larger reality.

And it is a reality the group has seized with cunning and alacrity. As Fernandez said: “People want to identify with something, and it is hard to identify with discredited institutions. And then along comes a ‘pristine’ organization that is seen as sincere and authentic. The ISIS narrative provides certain cultural, emotional satisfactions; it releases endorphins, inspires in a certain way. If everything around you has been discredited, you will have problems counteracting that. The lack of faith in Western culture prevents us from offering a positive alternative narrative. What moves us is evidently nothing—and you can’t counteract them with nothing.”

Adapted from War in 140 Characters: How Social Media Is Reshaping Conflict in the Twenty-First Century. Copyright © 2017 by David Patrikarakos. Available from Basic Books, an imprint of Perseus Books, a division of PBG Publishing, LLC, a subsidiary of Hachette Book Group, Inc.

Read more: www.thedailybeast.com