The third factor, which does hang over the now-almost-14-year-old war in Afghanistan (and which plays a big part in the “Hotel California rule”), is that the American military is not very good at training indigenous armies in countries facing threats from within and without. (See also South Vietnam and Iraq, among others.)
Military training is more complicated than many realize. True, the Taliban, al-Qaida, and ISIS don’t require advanced training for its recruits, so, it’s often asked, why should the Afghan or Iraqi army? But the two tasks are different. Insurgents can attack at a time and place of their choosing; if met with force, they can withdraw and attack someplace else. By contrast, armies defending the government have to be strong and ready everywhere, or they need to have the means to move quickly from one place to another.
So training is not just a matter of teaching soldiers how to shoot straight and maneuver on a battlefield (which American trainers do well). If the goal is to turn the fighting completely over to the local armed forces, then training must also involve teaching them how to conduct and call in air strikes, gather intelligence and apply it to tactical operations, move soldiers rapidly from one area to another (which involves flying helicopters or small transport planes), resupply soldiers when they’re deployed far from the base (logistics), and plan operations on a strategic or theater-wide level.