Many educated Afghans read Persian and then they could track Khomeini’s rise to power and the Iranian Islamists ’slogans and worldview towards them stemmed from their Shi’ite tone. The goal of forming a state fits well with the Afghans: affirming the universality of Islam, and condemning materialism and denomination among the great powers, which gave a greater goal to what would have been considered merely an alliance between traditional mullahs and clan leaders on the one hand, and Islamists on the one hand His other goal is to direct the Communist regime in Kabul and the reforms raised by this system ..
(Consequently, Iran has shown itself as a protector and defender of the rights of the persecuted Shiite minority in Afghanistan in the face of the Sunni-Wahhabi forces funded by Pakistan and Saudi Arabia.
2- Iran was aware of the importance of Afghanistan to its national security even before the 1979. revolution. Shah Muhammad Reza Pahlavi was The last king of Iran fears the spread of communism in Afghanistan and has provided economic and military support to various Afghan parties. Then the same concerns were shared by the government of the Islamic Republic, which replaced the monarchy in Iran. The leader of the Iranian revolution, Ayatollah Ruhollah Khomeini, was opposed to Soviet domination of Afghanistan and was a supporter of the spread of the Iranian revolution under what is known as the Wilayat al-Faqih (i.e. the ruler of the jurist)
Shi’ite scholars in Afghanistan at that time adopted a range of opinions on the role of religion in government, and Tehran provided the greatest support to the groups that Khomeini followed (Khomeini) and the Afghan Shiite groups evolved from Iran's bases to form the Afghan political party that he controlled The Hazara tribe.
However, the Islamic Republic, with preoccupation with internal unrest and the Iraqi invasion carried out by Saddam Hussein in 1980, has not been able to devote sufficient attention or resources to its eastern neighbor, and the Afghan Mujahideen, mostly Sunni groups, have received more support from both Pakistan Saudi Arabia and the United States Of America, although Iran has helped organize and direct the Mujahideen forces of Afghan Shiites ..
Iranian indulgence in Afghanistan increased after the departure of the Soviets and the fall of the Najibullah government in 1992, and the war with Iraq ended in 1988, which allowed the most stable Iran at the time to spend resources. It is sufficient to spread its influence in Afghanistan ..
_________________________________________________________
References:
The first clip [Cosmic Cold War]
Section Two [Research by the RAND Center for Defense and International Security Policy on Iranian Penetration into Afghanistan]