As best as I can ascertain, the heart of the problem in Afghanistan is the same as the heart of the problem in Vietnam. As an aside, I find this extremely ironic, because the anti-war critics have consistently treated Afghanistan as 'the good war' while directly comparing and conflating the second Gulf War with the Vietnam conflict - even though the two wars had very little in common.
I recognize the dangers of comparing Afghanistan to Vietnam after so many false analogies of that sort have been trotted out for less than honorable purposes. But Afghanistan and the Vietnam conflict have this fundamentally in common - the military situation is being created by a political consideration which is seen as precluding the ability to take the offensive against the enemy.
In Vietnam, strategic operational doctrine was driven largely by the belief that we must not go on the offensive lest we widen the conflict and bring China and or the USSR into the war directly. And in particular, this was considered to be unthinkable because of the possibility that such a conflict would go nuclear. In Afghanistan, we find ourselves in much the same situation.
In Vietnam, no serious offenses were launched into North Vietnamese territory. This allowed the enemy to have the initiative, to dictate the pace and timing of attacks, and to fight the war as a virtually unlimited war of attrition. It also allowed the enemy to have a virtual safe haven with which to stage attacks, recover, arm, and train. Winning in this situation would have been nearly equivalent to trying to win the American Civil War while making no incursions into the Southern United States. The enemy on the other hand not only had free reign to stage offensives in the south, but showed little respect for the borders of supposedly neutral neighbors as well, giving them logistical and tactical flexibility where their movements gained security from our own political sensibilities.