Posted:
The Soviets had no business getting involved with the Afghanistan War even though Afghanistan would have been better off under the yokes of the Soviets. The blood bath ensuing the Soviet Withdrawl, Afghanistan went in to total chaos killing off a large portion of their men over sixteen years old, nobody has ever been able to control Afghanistan for any period of time.
It is not difficult to background the Soviet involvement. In the 19th C, when 'western' powers developed their Imperialistic ideologies, there was a race by European powers to establish empires. You can read about the English, French, Dutch, Belgian, German, Italian and Russian empires if you want to.
And, the 'land of the free' wanted in on the action also. That's why, in addition to the chunks chopped off (or bought) from other Imperial powers, you can now find US (or, previous) US territories, stretching across the Pacific.
The English, finding it difficult to hold onto a restless India ( think the bloody Indian mutiny from 1857) became concerned when Russia started extending its influence into central Asia, and tried to take control of Afghanistan (more or less independent) and in 1904, again from fear of increasing Russian influence, invaded Tibet in an attempt to wrest it from the Chinese. The diplomatic discussions, following that failed attempt, went on for nearly two decades.
I mention all that to show that Russian influence was present in central Asia from mid 19th C. After the Russian Revolution and the end of Imperial Russia and the establishment of Soviet Russia, a number of dependent Soviet states were established in Central Asia, but Afghanistan remained independent (nominally at least).
The factor that brought Russian entry into Afghanistan was the Cold war, and a popular vote in Afghanistan which brought a socialist government to power (but, remember that many nations in the world had socialist governments - Australia included and India). Both Russia and the USA sought to checkmate the other and both started to find ways to undermine the other and expand their own influence. Afghanistan was unlucky enough to be important for the west to hold India and Pakistan. When a Afghani government collpased the Russians felt no option but to control the country.
In response, the USA began to arm and train fanatical Muslims to fight the Russians - and you have the start of current problems.
Wisdom is demonstrated by its results.