I am especially curious as to whether the Revolution spearheaded the Soviet intervention, and if it did what was the thinking of the Soviet political elite? Did they plan the intervention beforehand and had to just deal with the fallout from the revolution, or did the Revolution trigger the whole affair that eventually became one of the reasons for the collapse of the soviet union?
Long one but in sum: the Iranian Revolution had little bearing on the events in Afghanistan, and had Iran not overthrown the Shah, the Soviet intervention still would have occurred in exactly the same way.
Afghanistan’s descent into anarchy comes from the communist Saur Revolution, April 1978, which was supported by the Soviets. The former President, Mohamed Daud Khan, had himself overthrown the former King of Afghanistan, his cousin Mohamed Zahir Shah, in 1973, and, in addition to continuing the modernisation of the state started by the Shah (through education, women’s rights, suffrage etc), pushed strongly for the idea of Pashtunistan, unity of the Pashtun peoples currently split between Afghanistan and northern Pakistan. Communists were unhappy with Khan’s Pashtun nationalism, considering it impinged on the rights of the many minorities in Afghanistan’s borders, leading to his overthrow and execution.
The Saur Revolution cranked the pace of modernisation up to eleven, with land reform in particular being a strong cause of anger among the traditional tribal peoples of the countryside of Afghanistan. In addition, the repression of the People’s Democratic Party of Afghanistan, led by Hafizullah Amin as Prime Minister, who had imprisoned and executed several protestors and “counterrevolutionaries” had caused riots in many of the cities of the country. The socialist President, Nur Mohamed Turaki, called the Soviets for help with dealing with the rioters in March of ‘79, as well as manoeuvring to have Amin removed. Amin got wind of this and has Turaki killed and installed himself as president directly. Leonid Brezhnev, Soviet paramount leader, had had enough, and in a manifestation of the Brezhnev Doctrine (where the Soviets would intervene in the affairs of communist states where they were acting contradictory to Soviet goals) he invaded Afghanistan at Christmas ‘79, had Amin killed, and the war begins with mujahidīn taking up arms against the Soviets and Afghan government.
I’ve put this background in in order to show that the circumstances for Afghanistan’s Revolution and intervention where much different from Iran’s: Iran was a firm western ally, a wealthy nation, and the most powerful in the Middle East. The revolution in Iran was led by the public at first, then hijacked by the Ayatollah at a later date. Soviet meddling and complex debates about a nationalism of a specific ethnic group, such as with Afghanistan, were not featured with Iran. The way they link is through Soviet fears of an Islamization of the Central Asian Soviet republics. The theory goes that Iran’s Islamic Revolution, which had seen a secular dictator overthrown by a radical Shi’ite cabal, understandably gave the Soviets jitters, and it is arguable that Brezhnev came to stomp on Afghanistan to stop a similar Islamist revolution happening in Afghanistan and spreading northward. However, that leaves out two important differences that, in my view, discredit this idea:
All in all, one can draw a superficial comparison between Iran’s revolution and the Soviet intervention in Afghanistan, but in reality it represents a further implementation of the Brezhnev doctrine as had happened in Prague in 1968 - the Soviets would not let a state that had fallen into its sphere fall out again, especially given Afghanistan’s proximity to the Soviet Union’s borders.