Ken Burns Vietnam War documentary, exemplifies really well how limited commitment to fight a war, will result in similar situation as in Korea (to a degree, I guess), Vietnam, almost in Iraq, and now in Afghanistan.
US pulled out only because the general American public was bored of being in Afghanistan. Americans would had stayed there forever if they wanted to, and kept the Taliban at bay.