What would Afghanistan's history over the last 40 years have looked like without the 1979 Soviet invasion of Afghanistan?
I am doubtful that it would be too good, but it may have done better than OTL.
Prior to 1979, the Soviets had already assassinated the leading left wing leader (who the Soviets saw as being too radical since they saw his policies as needlessly aggravating the rural Afghans), the regime was increasingly seeking American support to supplement the support they were getting from the Soviets (which raised Soviet fears that Afghanistan might flip entirely from being friendly as it was under the king, meaning the Soviets would have hostile neighbours along their entire Southern border), there was already growing tension between urban and rural and Islamist and secular and nationalism was already dangerously high (witness the Afghan governments of the period and their rising interest in taking off the Tribal frontier zone off Pakistan which the Soviets really didn't like since even if Pakistan was a US ally, a big land grab right in their back yard was not something they wanted to see).
Without the invasion, IMO we see an earlier civil war. I'm not convinced that the Afghan government and secularists would have won that without serious Soviet intervention.
If the Soviets don't stage a major intervention, and instead cut their losses, things could get interesting, as Afghanistan falls to an Islamist regime at about the same time as Iran does. Alternatively, the US could step in, cut support for the rebels and up support for the secularist government in a bid to flip the already vacillating Afghans from the Soviet camp to the American camp.
fasquardon