Prior to 9/11, the United States had been carrying out small-scale covert operations in Afghanistan, ostensibly in cooperation, although often in direct opposition, with I.S.I., the Pakistani intelligence agency. While the US was trying to quell extremists, a highly secretive and compartmentalized wing of I.S.I., known as “Directorate S.,” was covertly training, arming, and seeking to legitimize the Taliban, in order to enlarge Pakistan’s sphere of influence. After 9/11, when fifty-nine countries, led by the U. S., deployed troops or provided aid to Afghanistan in an effort flush out the Taliban and Al Qaeda, the U.S. was set on an invisible slow-motion collision course with Pakistan. Today we know that the war in Afghanistan would falter badly because of military hubris at the highest levels of the Pentagon, the drain on resources and provocation in Muslim world caused by the U.S.-led invasion of Iraq, and corruption fed by N.A.T.O contracting and C.I.A. deal-making. But more than anything, as Coll makes painfully clear, the war in Afghanistan was doomed because of the failure of the United States to apprehend the motivations and intentions of I.S.I.’s “Directorate S.” This was a swirling and shadowy struggle of historic proportions, which endured over a decade and across both the Bush and Obama administrations, involving multiple secret intelligence agencies, a litany of incongruous strategies and tactics, and dozens of players, including some of the most prominent military and political figures. A sprawling American tragedy, the war was an open clash of arms but also a covert melee of ideas, secrets, and subterranean violence.