Political scientists and other scholars have spilled a lot of ink on the question of why big states lose small wars, i.e., wars against weaker adversaries. Phil Arena recently pointed me to
Patricia Sullivan's 2007 JCR article, which I have looked at (meaning looked at, not read every single word of). Her main argument, put in simplified form, is that big states are more likely to lose small wars when their objective is coercive, i.e., when it requires the adversary to change its behavior, as opposed to when the objective can be accomplished simply with brute force (i.e., overthrowing a regime or conquering territory). The main reason, she argues, is that big states are more likely to underestimate the costs of achieving coercive objectives. Sullivan has a typology of objectives on a continuum with brute-force objectives at one end and coercive objectives at the other. [Cf. Schelling, Arms and Influence (1966).]
Interestingly, the objective "maintain regime authority" falls in the middle of Sullivan's continuum. This is interesting because if you had to choose a three-word label for the U.S. objective in Afghanistan, it would be "maintain regime authority" (against those who seek to overthrow it). That was also basically the U.S. objective in Vietnam, as Sullivan suggests (i.e., the stated aim was to maintain an independent, non-Communist South Vietnam).
The main point I want to make is that looking at this article highlighted (once again) for me the distinction between those who emphasize the idiographic in their methods versus the nomothetic, or to put it in simpler terms (this would probably drive PTJ up the wall, never mind), the difference between those who do historical case studies and those who do formal modeling or quantitative work (yes, some people do both in the same book or article, but we'll put that aside for now).
Sullivan's approach would suggest that the wars in Afghanistan and Vietnam are basically similar because the objective (maintain regime authority) was the same. Of course she would acknowledge there are local differences, but she is not concerned with exploring them; she is interested in a model that explains, at some kind of quasi-'law-like' level, when big states lose small wars, and she gets there via a 'homogenizing' approach, so to speak. So if you took her approach, even though her concern is not explicitly with policy debates or decision-making, you might be quite receptive to analogies between Afghanistan and Vietnam.
A case-study approach might suggest something quite different. As opposed to a receptivity to the Vietnam-Afghanistan analogy, it might suggest a wariness about such an analogy and indeed about analogies in general. Yuen Foong Khong's Analogies at War (1992) showed quite convincingly that analogies to Munich and to the Korean War exercised a harmful influence on the Johnson administration's Vietnam policymaking. The takeaway lesson of that book, one could argue, is that because even smart people find it difficult to use analogies properly (i.e., in a sufficiently discriminating way), one should be wary of the mobilization and use of historical analogies, especially in a broad-brush way (e.g. "Afghanistan is like Vietnam"), in policy debates. Each case should be looked at primarily on its own, in other words.
One might say there is no contradiction here. Sullivan is interested in explaining outcomes, not prescribing a method for policymakers to use in decision-making. Khong is interested in showing why and how policymakers tend to misuse historical analogies. They are doing different things but not contradictory things. OK. Nonetheless, if you are a scholar with a more nomothetic mindset (e.g. Sullivan), if a policymaker called you and asked you what to do, you might start thinking in terms of historical analogies, because you are used to homogenizing historical cases and treating them as data points to be coded. Whereas if you have a more idiographic mindset, you might be less prone to think in terms of analogies, i.e., in terms of similarities between cases, and more prone to emphasize that each situation is unique. And I think that might be true even if, for purposes of getting your dissertation or article or book past the relevant authorities, you made a general argument that mobilized case studies in its support. Close contact with the historical specifics of cases, even when mobilized to support a general thesis or argument, is bound to sensitize one to differences and unique elements. In other words, even if (as is very often the case) you are doing case studies to develop or back up an overarching theory, you are bound, almost despite yourself as it were, to acquire some wariness about the merits of generalization.
Of course, our two hypothetical scholars might end up, policy-wise, in the same place: for example, both might have decided to oppose the Obama administration's "surge" in Afghanistan (or to favor it, as the case may be). But they would have reached their conclusion, whatever it was, by rather different routes.
P.s. Just to be clear (and repetitive), that the U.S. lost in Vietnam doesn't necessarily mean it's going to 'lose' in Afghanistan. This partly depends on how one defines 'victory'. (See this post and the attached comments.)