After the September 11, 2001 attacks on New York and Washington, it was clear that the al-Qaeda safe havens in Afghanistan had to be removed. Initially, the United States used special operations troops, but their first significant combat experience ended in almost total disaster. When the decision was made - and when the emphasis shifted from al-Qaeda to overthrowing the Taliban as part of the larger effort to chase the terrorists from their hidey-holes, I'm not quite sure - that it was necessary to topple the government of Afghanistan, it ended up being relatively easy, if for no other reason than "central government" has never been a strong suit in Afghanistan. US forces, moving quickly from supporting various factions to end Taliban rule to chasing down al Qaeda, essentially had them cornered in mountainous regions in the eastern region of the country. What has become known as the Battle of Tora Bora ensued with the happy result that the single individual most responsible for the attacks upon the United States managed to get away, his whereabouts still unknown.
Since that time, the US military has stayed behind in Afghanistan, using a shifting rationale that always seems to end up with "Al Qaeda is still out there," which, while true, is far more an admission of failure than a rational determinant of policy.
The American body count in Afghanistan has been on the rise recently as the Obama Administration has pushed a Marine-led offensive against the Taliban in an effort at political and military stabilization. This decision was made without a whole lot of fanfare, public discussion, or comment, and came after the election of a President by a public one of whose over-riding concerns was the unending, open-ended wars. Rather than seek a draw-down, Obama has pushed a troop increase in Afghanistan and the single biggest military effort since the actual invasion and anti-Taliban conflict eight years ago.
I would offer an historical parallel - the French war in Algeria. The on-going war against groups in Algeria that were seeking independence ended up draining various French governments of legitimacy until, for one last go-round, Charles DeGaulle insisted that only he could (a) end the war; and (b) do so in a way that saved France's honor and democracy. After taking office, he did (a) in a counter-intuitive way. He increased French military and police presence and began a systematic operation that included assassination, counterintelligence in a way unprecedented at any time previous, torture, indefinite detention, and other details that should sound familiar. The process was effective to the extent that the Algerian independence movement was rid of various terrorist elements, and French forces and civilians had a much easier time.
After an intense period where the conflict existed far below the radar of the French public, DeGaulle indeed pulled the French out of Algeria. The cost to the Algerians was quite high; the cost to French prestige and "honor" was also quite low, although it should have been far higher.
Something similar is happening in Afghanistan, with the added bonus of a military offensive led by an entire division of the best troops the United States possesses. While the initial action against al Qaeda was certainly justifiable, the ever-growing list of "must"'s that accompanied our initial action has become a living thing, existing independently of any human effort to create rational justifications for it. Whatever costs, whether political, military, fiscal, our diplomatic, always seem to be at stake when questions arise as to our presence in Afghanistan.
I have no clue as to how to get "unstuck" from our current position of "stuck" in Afghanistan; I only recognize that we are, indeed, stuck, and I see certain parallels between our own effort to stabilize the country, keep the Taliban from regaining power (which would be an open invitation to al Qaeda, it seems to me), and the French effort to tamp down the terrorist campaign the Algerian rebels waged both in Algeria and in France. Sometimes, reality leaves us with nothing but bad choices, and it would be wise to recognize that.