Nicholas A. Heras is a Fellow in the Middle East security program at the Center for a New American Security.

The rise of the Islamic State has haunted headlines throughout the world for the better part of a decade and has disrupted American plans to pivot to its intensifying competition with China and Russia. In “Shatter the Nations: ISIS and the War for the Caliphate,” Mike Giglio, an intelligence and national security correspondent for the Atlantic, tracks the growth and decline of the terrorist group in Iraq and Syria at the ground level, among local Syrians, Iraqis, Turks and others who experienced the war firsthand.

Giglio, who was previously based in Istanbul for BuzzFeed, draws heavily from his experiences mingling with the smugglers, spies, refugees, aid workers, journalists and jihadists on Turkey’s southern frontier with Syria. Giglio even travels into the heart of darkness itself, the Islamic State’s so-called capital — the northwestern Iraqi city of Mosul — where he chronicles the battle to wrest the city away from the terrorists, a grinding, bloody endeavor waged by various barely coordinated Iraqi security forces (Kurds, Arabs and others), all backed by the United States and its allies.

“Shatter the Nations” is not a comprehensive repository of all things related to the Islamic State, in Syria and Iraq or globally. Instead, readers should expect quirky and important discoveries about the war and its transnational impact on oil smuggling, the running of refugees into Europe and the black market for antiquities. These activities helped support the Islamic State’s war machine, and Giglio is in his element explaining how they fit together as the militant group started to grow into a monster force. He rolled into battle with members of America’s local counter-Islamic State partners, and he captures the makeup of this motley crew.

But Giglio might have provided a more nuanced portrait of the People’s Protection Units, commonly known as the YPG, a Syrian Kurdish-majority force that includes Arabs and other groups. The YPG became the backbone of the larger, multiethnic, multisectarian Syrian Democratic Forces (SDF) coalition, which emerged as a close U.S. partner against the Islamic State in Syria. It was the YPG’s work with Arabs that caught the eye of the U.S. military as it sought to open a front against the Islamic State in Syria. Over time — and with the encouragement and support of the United States and its allies — the YPG built up the SDF into a force numbering tens of thousands that remains the key U.S. partner against the Islamic State.

Giglio casts the YPG in a somewhat negative light, describing it as a group that sided with Syrian President Bashar al-Assad, is hated by fellow Syrians and is a proxy for the Kurdistan Workers’ Party, which is listed as a terrorist organization by Turkey and the United States. Giglio characterizes the YPG as “of another place and time, a throwback to leftist radical groups that flourished across Europe during the presidencies of Jimmy Carter and Ronald Reagan” and one that “killed or kidnapped” Syrians, causing some family members to join the Islamic State.

It is true that a significant part of the YPG has been influenced by the social movement led by Abdullah Ocalan, whom the Kurdistan Workers’ Party considers a spiritual father, and that some Syrian veterans of the party joined the YPG. Giglio notes that he traveled to Ras al-Ayn and al-Yarubiyah, two strategic border cities in northeast Syria, and that he witnessed firsthand the activities of the YPG. However, he does not explain that in both these cities the YPG worked closely with Arab allies to defeat the Islamic State and other radical militant Sunni Islamist groups, and that the alliances built between the YPG and Arab allies in these areas endure today. As I have seen over the past five years on field trips to northeast Syria, the SDF (including the YPG) is building a multiethnic, multisectarian political, administrative and security organization to stabilize post-Islamic State areas, placing women and minorities into decision-making positions. Perhaps most important, at least hundreds of members of the Syrian opposition, mostly Arabs, have returned to northeast Syria after they were forced into exile by the Islamic State and are now working to help build SDF-led governance operations.

That is why, while by no means perfect, the YPG (and the SDF) is much more than the caricature that Giglio presents in “Shatter the Nations.” Unfortunately, Giglio missed an opportunity to help the reader understand why the United States chose to partner with this group.

Nevertheless, “Shatter the Nations” mostly succeeds as both a firsthand account of the war against the Islamic State and as something of a philosophical rumination on the larger “forever war” that the United States launched after al-Qaeda’s Sept. 11, 2001, attacks. Giglio has written an engaging and valuable account of the battle against the Islamic State and its regional and international effects. He captures, better than most any other author, the gritty, confusing and often cynical nature of this war fought by local actors on behalf of the United States. Readers who embark with Giglio on his harrowing adventures will gain much from his eye for the details that humanize his tale. Readers also will come away with a strong understanding of why the uprisings in Syria and Iraq metastasized into a multinational conflict that will reverberate for generations to come.

Shatter the Nations

ISIS and the War for the Caliphate

By Mike Giglio

PublicAffairs. 303 pp. $28