> Governments don't lose power unless they lose a war, a rare event today that was common 100 years ago.
A good point, but of course they do lose power with every election - that's the point, a peaceful transition of power.
(Also much of the rest of the Warsaw Pact, and others around the world.)
Afghanistan is very much a reason why they no longer exist.
It out-endured them within its own territory. Much as has happened to the US several times, with resulting embarrassment but not regime change.
Military spending on the part of the US, falling global oil prices, multiple internal contradictions and failures, revolt within Warsaw Pact states, and growing internal dissent were far more significant contributors to the ultimate fall.
Britannica and World Atlas give similar accounts:
<https://www.britannica.com/story/why-did-the-soviet-union-co...>
<https://www.worldatlas.com/articles/10-reasons-for-the-colla...>
For example, one wouldn't claim that the de-facto American loss of the wars in Iraq and Afghanistan is directly affecting the stability of the American regime, would they?
Coming back to the Soviets, I would concur to a claim that the Afghan War was a failed national project, alongside the Chernobyl tragedy and the ecological disaster of the Aral Sea. The narrative I think proper here is first and foremost is the ordinary Soviet citizen's loss of trust in the Soviet way as such, rather than the specific fear of a foreign invasion.