In the Roman conquest of Gaul, Julius Caesar led his legions into battle wearing a flowing red cape. The cape made him more likely to be killed but easier for his men to see; it served as a reminder of his fearlessness. John Bell Hood, one of the Confederacy’s most audacious commanders, had his left arm shattered at Gettysburg, and lost his right leg at Chickamauga; from then on, he rode into battle tied to his horse. Even in the Second World War, when senior officers had it easier than their predecessors, General Dwight Eisenhower was so consumed by the job that he smoked four packs of cigarettes and drank fifteen cups of coffee a day.

“The rucksack of responsibility is very heavy,” Petraeus told troops. In Iraq and Afghanistan, how well he carried it is open to debate. Illustration by Stanley Chow

Nowadays, most general officers, at least most American ones, do not see combat. They don’t fire their weapons, and they don’t get killed; for the most part, they don’t even smoke. In wars without front lines, American generals tend to stay inside fortified bases, where they plan missions and brief political leaders via secure video teleconferences. Their credentials are measured as much by their graduate degrees as by the medals on their dress uniforms. They are, for the most part, deeply conventional men, who rose to the top of the military hierarchy by following orders and suppressing subversive thoughts.

In recent years, the most esteemed officer in America—the very model of the modern general—was David Petraeus, whose public image combined the theorizing of the new school with a patina of old-fashioned toughness and rectitude. Before a sex scandal forced him to step down as the director of the C.I.A., a few weeks ago, he was widely regarded by politicians and journalists as a brilliant thinker and leader, the man who saved America in Iraq and might work a similar miracle in Afghanistan. Roger Ailes suggested, perhaps less than half in jest, that Petraeus run for President. Now many of the same people are calling into question not just his ethics but his basic ideas and achievements. History often forgives military leaders for small scandals, if they are successful enough. Eisenhower’s long-alleged affair with Kay Summersby has not much tarnished his reputation as an officer; even Hood, whose late campaigns were disastrous, is remembered as a paragon of bravery, if not of good planning. Will Petraeus be thought of, in time, as a hero guilty of no more than a distracting foible? Or as the general most responsible for two disastrous wars?

In Iraq and Afghanistan, most of the criticism has centered on the political leaders—Bush, Cheney, and Rumsfeld—who ordered the invasions and grossly mismanaged the occupations that followed. Less criticism has focussed on the soldiers and the generals who led them. This is understandable: the military didn’t start these wars, and the relatively small number of Americans who fought in them—after a decade, less than one per cent of the population—bore the burden for the rest of the country. In all those “Support Our Troops” bumper stickers and campaign applause lines, it has not been difficult to discern a sense of collective guilt.

But, by almost every measure, the American soldiers and marines who went into Iraq and Afghanistan were grossly unprepared for their missions, and the officers who led them were often negligent. In the months leading up to the invasion of Iraq, many American military units travelled to the National Training Center, a sprawling patch of California desert. There they took part in enormous mock tank battles against a phony enemy, called the Kraznovians, that was meant to stand in for the Iraqi Army but had in fact been modelled on the Soviet military in an imaginary invasion of Western Europe. When the real invasion got under way, in March, 2003, American soldiers came under attack from a hidden enemy that was wearing no uniform at all. There had been plenty of warnings that an anti-American insurgency might spring up, and none were heeded. The generals were unprepared.

How the Army got to such a point is the subject of Thomas Ricks’s “The Generals,’’ a series of vivid biographical sketches of American commanders from the Second World War to Afghanistan. In Ricks’s view, their quality, with a few exceptions, has steadily declined. His poster boy for the terrible early period of the Iraq war is Lieutenant General Ricardo Sanchez, whom he accurately portrays as a decent man but an incompetent commander. Sanchez’s worst decision was signing off on harsh interrogations of Iraqi detainees—which, when the photographs leaked from Abu Ghraib, resulted in one of the war’s signal disasters. But his real sin was neglect. Stupefied as the insurgency spread around him, and paralyzed by Washington’s insistence that everything was under control (for months, Rumsfeld forbade American officers to use the word “insurgency”), Sanchez effectively delegated the strategy for the war to the lower-ranking generals beneath him.

In the summer and fall of 2003, many of those generals turned their men loose on Iraq’s population, employing harsh measures to round up insurgents and compel civilians to hand them over. The central tactic was to sweep villages in the country’s Sunni heartland—the center of the insurgency—and haul in the military-age men. These young men, who were mostly of no intelligence value, were often taken to Abu Ghraib, where their anger ripened. I witnessed several such roundups, and could only conclude that whichever of these men did not support the uprising when the raids began would almost certainly support it by the time the raids were over. Faced with a small but significant insurgency, American commanders employed a strategy that insured that it would metastasize.

During the crucial first year of occupation, the one general who cut a conspicuously different path was Petraeus. After leading the Army’s 101st Airborne Division in the invasion, he settled his troops in the northern city of Mosul, and began to implement the counter-insurgency strategy that has become his signature. What distinguishes this method from other types of war-fighting is its focus: instead of concentrating on the enemy you want to kill, concentrate on the civilians you want to protect. At the time, this idea was considered exotic in the Army. But, two hundred and fifty miles removed from Baghdad, Petraeus could ignore his commanders’ edicts. He put former Baathists on the payroll and spent millions on things like irrigation projects and new police. “Money is ammunition,’’ he liked to say. Killing bad guys was relegated to a lower priority. Soldiers on patrol were not even permitted to fly American flags. Through much of 2003, while Iraq imploded, Mosul stayed relatively calm.

In coming years, Petraeus’s Mosul experience became the American strategy for all of Iraq. The way it did so is the subject of Fred Kaplan’s forthcoming book “The Insurgents.” (The title is ironic: the insurgents in Kaplan’s compelling story are a dissident group within the Army.) In Kaplan’s telling, a small group of men, with Petraeus the most prominent, found one another and mounted an end run around the military bureaucracy, thereby saving Iraq, and probably the entire Middle East, from a war even more cataclysmic than the one we already had.

A book about bureaucratic change would make for dry reading if it didn’t have a colorful main character, and Petraeus, wherever he goes, appears ready-made: he’s smiling, educated, super-fit, and very smart—and he likes to talk to reporters. In news stories, he emerged as unfailingly driven and precise. “All In,” the recent biography by Paula Broadwell, portrays him as “intense,” “smart,” “all energy”—a superhero in fatigues. As we now know, owing to the revelations about Petraeus’s extramarital affair with Broadwell, he is also a human being. But neither Broadwell’s book, which extolls Petraeus on practically every page, nor the recent attacks on his character offer much help in assessing what sort of general he actually was.

The truth is Petraeus really was exceptional. In many ways, the biggest problem that the American military faced in Iraq was itself. When Petraeus and other officers tried to change the approach in Iraq, they hit a wall of entrenched resistance. After the war in Vietnam, American generals banished the idea of counter-insurgency, perhaps figuring that if they didn’t plan for such a war they wouldn’t have to fight one. Military academies were dominated by such notions as the “Powell doctrine,” which held that future wars should be fought with maximum force and brought to an end as quickly as possible. In Ricks’s telling, the American military, by the time of the attacks of September 11, 2001, was a sclerotic institution that rewarded mediocrity and punished innovative thinking. In recent years, eighty-four per cent of the Army’s majors have been promoted to lieutenant colonel—hardly a fine filter. Becoming a general was like gaining admission to an all-men’s golf club, where back-slapping conformity is prized above all else. When the invasion of Afghanistan and Iraq began, the top U.S. field commander was General Tommy Franks, a shortsighted tactician who didn’t bother to plan for the occupation of either country. Franks had the good sense to step down in the summer of 2003, just as Iraq began to come apart.

Ricks argues, convincingly, that what changed in the military was the practice of firing commanders who failed to deliver results. His starting point is General George Marshall, the Army chief of staff during the Second World War, who culled underperforming generals and promoted the better ones, constructing a ruthlessly efficient fighting force. The practice withered during the Vietnam War, replaced with micromanagement by civilian leaders. (Recall photographs of Lyndon Johnson choosing bombing targets.) With even the most mediocre generals moving upward, the Army ossified at the top. Sanchez was not the exception; he was the rule. “Like the worst generals of the Vietnam era, he tended to descend into the weeds, where he was comfortable, ignoring the larger situation—which, after all, was his job,’’ Ricks writes. Yet Sanchez paid no price for his failures, Ricks notes: “The vocabulary of accountability had been lost.”

In Iraq, the generals, and increasingly their troops, trapped themselves inside their bases, cut off from the country they were trying to occupy. When their strategy didn’t work, they tended to redouble their efforts—capture more insurgents, turn over more neighborhoods to the Iraqi Army—and justify their actions in the impenetrable jargon that modern officers use with one another. Iraqi insurgents became “A.I.F.” (anti-Iraqi forces), Al Qaeda in Iraq was “A.Q.I.,” and a car bomb was an “S.V.B.I.E.D.” (suicide vehicle-borne improvised explosive device). Petraeus revelled in the jargon—among junior officers, his PowerPoint presentations were spoken of in reverent tones—but, at least in his case, the fancy terms were suggestive of his knowledge, and not the end of it. My own snap test for measuring an American general’s perceptiveness was how he pronounced Iraqi names. In 2006, I heard General J. D. Thurman, the commander presiding over Baghdad, pronounce the name of the Iraqi Prime Minister three different ways in a single interview, all of them incorrect. General Thurman apparently wasn’t talking to Iraqis—or, if he was, he wasn’t listening.

Petraeus was smarter and quicker than most of his colleagues. He wasn’t a rebel, at least on the surface. He loved the Army and relished its history, and the trappings and the medals, and, in talking to reporters, he was careful never to go too far. He didn’t have much combat experience, but that seemed to make it easier for him to see beyond the daily slog of killing insurgents. He had a Ph.D. from Princeton—dissertation title, “The American Military and the Lessons of Vietnam.” (This did not necessarily help his career, Kaplan writes: “He was aware of his reputation in certain circles as a schemer, a self-promoter, and, worst of all, an intellectual.”) He was preternaturally, pathologically competitive. Once, inside a building in Baghdad, Petraeus, then in his early fifties, challenged me to race him up the stairs. (He won.) Another time, he dared me to join him on a morning run in the Green Zone, accompanied by an armed guard. When the run was over, Petraeus initiated a pull-up contest, and did seventeen, an astounding number. “You can write that off on your income tax as education,’’ he said.

His emphasis on physical fitness sometimes seemed like a postmodern version of Hood’s courage: if our generals were not going to face physical danger, they could at least do more pushups than the men who would. Reporters loved it, and so did Petraeus’s fellow-soldiers. Being physically strong still matters in the U.S. Army. General Ray Odierno, as a division commander in Iraq in 2003 and 2004, did as much as any senior officer to push the country toward disaster, but he looked the part: six feet five inches tall, with a bruiser’s physique and a shaved head. He is now the Army chief of staff.

In the summer of 2004, Sanchez was replaced by General George Casey, whose main objective was to train an Iraqi Army and police force to take over so that the Americans could get out. Casey was more effective and sharper than Sanchez—“George Bush has given me a pile of shit,’’ Kaplan quotes him as saying—but his job was to put the best face on an American retreat. As anyone who took a moment to drive the streets could see, the Iraqi Army was incapable of bringing order to the country. Shiite death squads roamed Baghdad. Every morning, scores of Iraqi bodies would turn up, frozen in their last terrible moments: heads bagged, hands cuffed, shot between the eyes.

So where did the death squads come from? Many of them were members of the Iraqi Army and the police, which had been trained largely by the Americans. And what American oversaw this training, in the crucial pre-civil-war years of 2004 and 2005? David Petraeus, as the head of Multinational Security Transition Command, during his second tour in Iraq. In that time, the Americans ran a crash program, drawing in tens of thousands of recruits—mostly young Shiites. Some American officials raised concerns, suggesting that the recruits be vetted, but they were rebuffed. On Petraeus’s watch, the Americans armed the Iraqis for civil war. Neither Kaplan nor Ricks (and certainly not Broadwell) explores this aspect of Petraeus’s time in Iraq; it’s the one part of Petraeus’s career that he doesn’t talk much about.

By late 2006, the Sunni insurgency had been largely taken over by extremist groups like Al Qaeda in Mesopotamia, who were attacking Shiites, the country’s largest sect. The Shiites turned to their own militia, the Mahdi Army—and to the death squads—to protect them, igniting the civil war. The situation seemed hopeless—and this sense of hopelessness gave an opening to the American insurgents. Kaplan tells the story well. From the beginning of the Iraq war, a number of officers and policy intellectuals, including Petraeus, believed that the war had to be fought a different way. In the few places where the principles of counter-insurgency had been put into practice—as they had in Tal Afar, in 2005, by a gutsy colonel named H. R. McMaster—the anarchy receded. The idea was this: The parties to the civil war—the Sunni minority and the Shiite majority—would never reach an accommodation as long as they were still butchering each other. The only chance lay in forcing a pause that would allow the bargaining to begin. Only a massive deployment of troops could provide that kind of pause.