But the stone age fighters of the Taliban countered these “advanced” western weapons with no problem and chased the Americans out?
Different kind of war because different social and geographical circumstances. The biggest one was that the Taliban was fighting the US, which for its own internal political reasons was unwilling to do what it took to control the Afghan population. That is, implement a system of reconcentration/ “strategic villages”/ethnic cleansing or what have you.
The US problem in Afghanistan wasn’t a contest of firepower with a peer enemy and an effective abscence of civilians on the battlefield. That is Ukraine.
The Taliban, unlike the Russians, relied largely on light infantry tactics with a very short logistical tail. The Russians are dependent upon masses of artillery and concentrated firepower, and so are vulnerable to supply disruption in a way the Taliban was not.