West Asia was divided into two big empires in the 1500s AD – the Ottoman Empire and the Safavid Empire. Both the Ottomans and the Safavids followed Islam, but they followed two different kinds of Islam. The rulers and most of the people of the Ottoman Empire followed Sunni Islam, but in the Safavid Empire most people followed Shiite Islam. These two empires had many reasons for fighting each other, but one of the reasons was their religious differences.
There were also smaller groups of people living in both the Ottoman and the Safavid Empires who did not follow Islam – Christians, Buddhists, and Jews. Mostly the Ottomans and the Safavids were pretty much okay with people having different religions, though they had special rules for how non-Muslims had to live and often made them pay extra taxes.
About 1700 AD, the Safavid Empire collapsed, and the general Nader Shah started the modern country of Iran. Nader Shah wanted peace between the Ottomans and Iran, and he wasn’t very interested in religion himself, so he tried to change Iranian Shiism so that it would be more like Sunni Islam, and there would be less fighting about it.