It all goes back to Shah Ismail I and the Safavids.
Ismail I (1487 – 1524 AD), founder of the Safavid dynasty, was militantly Shi'a. I mean that literally - he was a grandson of Sheikh Junayd, a relatively minor figure who turned the Safaviyya religious order from Sufism to Shi'a, as well as turning the order into a military movement. Junayd's son Haydar continued this trend and became even more extreme, and amplified the incipient religious authoritarianism. Ismail ultimately inherited that military and religious mindset. He led the Turkoman Qizilbash to an attack on Tabriz, and after taking control of the rest of Iran, instituted Twelver Shi'a as the official religion and began the suppression of other schools. He exiled or killed Sunnis who would not convert to his brand of Shi'ism, destroyed Sunni mosques, and disbanded Sufi orders.
It should be noted Ismail's religious knowledge was questionable at best. Judging from his poetry and writing he had quite the messianic complex, and had a poor grasp on Shi'ite theology. Shi'ism among the early Safavids was not standardized, and there were no Shi'ite law books in circulation for quite a while. To solve this, and in an effort to prevent any sort of unrest or feelings of ethnic favoritism, he invited prominent Shi'ite jurists from neighboring areas to begin converting the population. These jurists were eager to work with the Safavids and spread Shi'ite Islam, and were rewarded with important positions, paritularly Sheikh ul-Islam and Ayatollah, and they began teaching in madrasas. In turn, the jurists reinforced Ismail's authority and legitimacy (this all happened in a manner coincidentally very similar to the house of Sa'ud and their reliance on religious scholar Muhammad ibn Abd al-Wahhab a few centuries later, leading to Saudi Arabia being strictly Wahhabi).
Ismail's successors, with a few exceptions, continued the trend of forced conversion and proselytization. But after Ismail I, the most significant person is the cleric Muhammad Baqir Majlisi (1616–1698 AD). A very conservative orthodox cleric, he went to great lengths to stamp out religious minorities and enforce Twelver Shi'a doctrine in Iran. He is frequently regarded by Twelvers as a mujaddid, a "renewer" of Islam, a person who comes once in a century to correct improper practice and purify the faith. His work not only enforced orthodoxy in Iran, but he also came to be considered one of, if not the most influential Shi'a cleric of all time, thanks to his large corpus. His work still influences Twelver Shi'a to this day.
This is just an outline of course, but it's a very interesting topic. If you'd like to get a more complete picture, you should read Islam Without Allah?: The Rise of Religious Externalism in Safavid Iran By Colin Turner, Converting Persia: Religion and Power in the Safavid Empire by Rula Jurdi Abisaab, and Safavid Iran: Rebirth of a Persian Empire by Andrew J. Newman.