Robert Farley thinks through the process of leaving Afghanistan:
In order to keep peace with his security bureaucracy, particularly the military and the CIA, Obama effectively has to negotiate internally for reductions he might hope to make to the current Afghan contingent. The power of the president over his own bureaucracy is limited, as bureaucratic warriors have many means for resisting policies that they dislike.
The United States military may be the most important player in the negotiations, and elements of the military are absolutely dedicated to a narrative of victory in Afghanistan. While the actual impact of the Surge in Iraq will be debated for years, the increase in the size and tempo of military operations in early 2007 along with the major reductions in violence that followed gave the U.S. military a narrative of victory in that conflict. Whatever the shortcomings of U.S. operations in the first stages of the Iraq War, by its end, the Army — and to some extent the Marine Corps — could explain to itself and others that it had learned to fight counterinsurgency in the proper way, and that it had effectively defeated enemy forces in Iraq. The availability of such a narrative may have been crucial to the Army's willingness to acquiesce in the substantial U.S. drawdowns of the past few years.
Applied to Afghanistan, this logic makes the overriding institutional interest of the U.S. military — again, particularly the Army and Marine Corps — relatively simple: Avoid defeat.