Gen. David Petraeus has served honorably, and well, for roughly four decades, and he is generally recognized as one of the finest officers of his generation.

In contemplating his legacy and how it has shaped the force, two key episodes stand out: his initial doubts about the Iraq invasion and his eventual enthusiasm for more Iraq-style nation-building missions as reflected in the Army and Marine Corps counterinsurgency doctrine that bears his imprimatur.

It is easy to forget that Gen. Petraeus was first introduced to millions of Americans long before he took command in Iraq. As he prepared to lead the 101st Airborne Division across the border separating Kuwait from Iraq in March 2003, then-Maj. Gen. David Petraeus turned to Washington Post reporter Rick Atkinson and asked quizzically, “Tell me how this ends.”

It was a good question because it leads to others, most of which the Bush administration failed to ask, let alone answer. What political end is our invasion supposed to achieve? Does that end advance U.S. security? Can we accomplish it at reasonable cost?

Our experience in Iraq shows that achieving even a modicum of stability exacts a cost to our security far greater than its benefit. Among the most important lessons drawn from the war in Iraq is that we should leave the problem of repairing weak and failing states to the people living in them. But Washington came mostly to a different conclusion, and for that David Petraeus deserves much of the credit or the blame, depending upon one’s perspective.

Rather than continuing to ask how a particular war was likely to end, and therefore testing the proposition that it was worth fighting in the first place, Petraeus perfected the art of fighting unnecessary wars. If Iraq was likely to end badly, the solution was better planning, more money and more time. And if Iraq ultimately could be made to work, then the model could be replicated elsewhere. Armed nation-building was an often thankless task, but Petraeus concluded that it was a vital one, and therefore one that the Army and Marine Corps must learn and perfect. This required more boots on the ground, and that the troops stay in country longer.

But the effort to perfect our ability to defeat insurgencies and order chaotic states has prevented us from noting how rarely these skills are needed.

I hope that Gen. Petraeus’s legacy leads to fewer foreign wars, and reflects the wisdom and caution that he revealed in a private moment before the start of the Iraq war. I worry that the opposite will be true, and that our brave men and women in uniform, following the doctrine that Petraeus drafted and promulgated, will fight more wars, in more places, but with precious little to show for it.