A van damaged by shrapnel sits abandoned in the Oktyabrsky district in Donetsk, Ukraine. David Patrikarakos writes that the conflict there is as much a war for public perception as a battle for territory. (Alexander Ermochenko/Reuters)

Matti Friedman’s most recent book is “Pumpkinflowers: A Soldier’s Story of a Forgotten War.”

In the 1990s, I served as an infantryman at an obscure Israeli outpost in southern Lebanon whose claim to fame was a curious incident one Saturday morning in 1994: A Hezbollah team assaulted the hilltop base, surprised the garrison, planted a flag and ran away.

What made this attack different, in those ancient offline days, was that one of the Hezbollah fighters was armed not with a rifle but with a video camera. Dramatic footage of the flag planting, with echoes of Iwo Jima, was broadcast via newly proliferating satellite dishes and appeared on TV across the Middle East. Hezbollah declared victory. The Arab world cheered. Israelis fumed over a perceived debacle. The narrative tide in the guerilla war between Israel and Hezbollah began to shift in Hezbollah’s favor. On the ground, nothing of military importance had happened. But the jihadists grasped first that it didn’t matter — that new information technologies evened the playing field and that a great success in the real world mattered less than a great story on a screen.

The revolutionary digital landscape then in gestation, and now in full swing, is the subject of an important and accessible new book by journalist David Patrikarakos, a contributor at the Daily Beast and Politico and the author of an earlier book on Iran's nuclear program. The idea for "War in 140 Characters," Patrikarakos writes, came a few years ago "while lying on my bed in a bleak room of the Ramada hotel in Donetsk, listening to the sound of shelling on the city's outskirts."

****HANDOUT IMAGE “War in 140 Characters,” by David Patrikarakos, (credit: Basic Books) ***NOT FOR RESALE (Basic Books)

Reporting on the war between Russia and Ukraine from that city, he found that Twitter knew things long before traditional media did and that part of the Ukrainian army’s supply system was run by a woman who had a Facebook account and no official job. But it wasn’t just that: The actual military moves seemed less important than the stories both sides were spinning online. “Whereas in a war as it is traditionally understood, information operations support military action on the battlefield,” Patrikarakos writes, “in Ukraine it became clear that military operations on the ground were supporting information operations on TV and in cyberspace.”

Reading these lines reminded me of the sharpest analyst of this trend in its primitive stages — Conrad Brean, the character played by Robert De Niro in the 1997 Hollywood masterpiece "Wag the Dog." Brean is a troubleshooter hired by the White House to divert public attention from a sex scandal by creating a fake war on TV. When a presidential aide protests that the American public will discover the ruse, Brean isn't troubled: "What did they find out about the Gulf War?" he asks. "One shot: One bomb, falling through the roof, building could've been made of Legos." No one even knew if it was real.

The war that Patrikarakos was experiencing in Ukraine seemed less about territory than people’s perceptions of what was happening. Or as De Niro’s character would have put it, the rubble in Donetsk, the tanks — it could all have been Legos.

The quest to figure out this bewildering new world sends Patrikarakos from Ukraine to Siberia, where he interviews a recovering Russian Internet troll, and to France to meet a woman lured to the Islamic State by recruiters from the “virtual caliphate.” He tracks down a British video-game nerd who, in 2014, abandoned the fighting elves of “World of Warcraft” to lead a remarkable investigation of the downing of Malaysia Airlines Flight 17, undermining Russia’s denial of responsibility and becoming an international figure of some significance — all on his computer, without leaving his living room.

To illustrate how the balance of power has shifted, the author interviews Farah Baker, a young Palestinian woman who tweeted the 2014 Gaza war when she was 16, and then interviews her online opponents, kids a few years older in Israeli army uniforms. Baker came to global attention broadcasting a gripping view of the airstrikes in Gaza from her smartphone, and she was able to get the upper hand against the Israelis in part because she was weaker: She was just one person, not part of a big organization with a carefully tailored message. The Palestinian girl had an “inherent authenticity,” Patrikarakos writes, and in the new social media world, this “is the advantage that a Farah has over an institution” like the Israeli Defense Forces.

Elsewhere in the Middle East, the author recounts how the tech-savvy militants of the Islamic State rose from the ashes of Iraq in tandem with the rise of YouTube and Twitter. Those new tools allowed them to inflate accomplishments, terrorize from afar and galvanize global attention far beyond the dreams of their predecessors, like that Hezbollah team with its video camera in 1994. The U.S. effort to fight back online doesn’t stand a chance: We learn that on the day in 2014 when the Islamic State took Mosul, Iraq, staffers in a State Department office tried to “hijack” the militants’ hashtag #CalamityWillBefallUS, furiously putting out their own counter-messages. Tallying the results that night, they found that of the 100,000 tweets using the hashtag, the material being pushed by the superpower accounted for all of 1 percent. “A major arm of the government of the world’s most powerful nation,” Patrikarakos writes, “simply could not compete with networked individuals operating out of dilapidated buildings in war-ridden Syria or teenagers sitting in their bedrooms creating and sharing content.”

This modern form of war may involve tweets and two-minute videos fired off by teenagers with rapid thumbs, but there’s something comforting in the fact that explaining it needs to be done the old-fashioned way: in a book, by someone experienced in the real world and trained in the craft of explaining. Patrikarakos has performed a service by giving readers a relatable, even enjoyable, introduction to the way the battlefield has moved onto our phones and laptops, and from there directly into our brains. “War in 140 Characters” is a necessary read for everyone affected by this baffling state of affairs — that is, everyone.

War in 140 Characters

By David Patrikarakos

Basic. 301 pp. $30