A Taliban reconquest would also, it should be said, be a moral atrocity from which American self-respect would not soon recover.

Proponents of withdrawal often acknowledge the costs of defeat but argue that the cause is hopeless anyway. On this, let me note a certain pattern. When you interview people who know little about Afghanistan, they describe an anarchic place that is the graveyard of empires. When you interview people who live there or are experts, they think those stereotypes are rubbish. They usually take a hardened but guardedly optimistic view. Read Clare Lockhart’s Sept. 17 testimony before the Senate Foreign Relations Committee to get a sense of the way many knowledgeable people view the situation.

Amidst all the problems, the NATO coalition has a few things going for it. First, American forces have become quite good at counterinsurgency. They have a battle-tested strategy, experienced troops and a superb new leadership team. According to the political scientists Andrew J. Enterline and Joseph Magagnoli, since World War II, counterinsurgency efforts that put population protection at their core have succeeded nearly 70 percent of the time.

Second, the enemy is wildly hated. Only 6 percent of Afghans want a Taliban return, while NATO is viewed with surprising favor. This is not Vietnam or even Iraq.

Third, while many Afghan institutions are now dysfunctional, there is a base on which to build. The Afghan Army is a successful institution. Local villages have their own centuries-old civic institutions. The National Solidarity Program was able to build development councils in 23,000 villages precisely because the remnants of civil society still exist.

We have tried to fight the Afghan war the easy way, and it hasn’t worked. Switching now to the McChrystal strategy is a difficult choice, and President Obama is right to take his time. But Obama was also right a few months ago when he declared, “This will not be quick, nor easy. But we must never forget: This is not a war of choice. This is a war of necessity. ... This is fundamental to the defense of our people.”