Ok so I was wondering why the hindus in India did not become muslim like the Zoroastrians in Iran. Some cities like delhi where under islamic rule for like 600 years, yet they did not become majority muslim. And to my understanding Zoroastrianism was more organised than Hinduism. Also weren't other religions like Buddhism and Jainism more prevalent in India during the middle ages, meaning it is easier to convert.
So again, why wasn't India islamic like other countries such as Iran?
This is a very broad question that doesn't have a single answer, but I'll bullet point some of the most common explanations that have found consensus among historians of India. Hopefully a historian of Iran can provide the other half of the answer to your question.
Sources:
C. A. Bayly, "The Pre-History of 'Communalism'? Religious Conflict in India, 1700-1860," Modern Asian Studies, 19:2 (1985)
Cynthia Talbot, “Inscribing the Other, Inscribing the Self: Hindu-Muslim Identities in Pre-Colonial India,” Comparative Studies in Society and History 37, no. 4 (1995): 692–722.
Metcalf, Barbara D., and Thomas R. Metcalf. A Concise History of Modern India. Cambridge University Press, 2006.
The first thing I’d say is that Iran didn’t become Islamic overnight. Today we think of Iran as country dominated by conservative Shia Islam, however this only really dates to the 17th century when the Safavid dynasty made Twelver Shi’ism the official religion. The notion of Iran being ruled by a council of clerics only dates back to the 1980s.
For the early Arab conquerors it was a far better option not to convert the Persians. It made the transition to the new regime smoother and opened the population up to paying the jizyah, the Islamic poll tax on non Muslims. It probably wasn’t until after the Abbasid revolution in the 850s CE (200 hundred years after the conquest) the the Muslim population of Iran slipped over 50%. You can see similar patterns in other countries. When the crusaders arrived in Palestine in the 1090s the vast majority of the population was Christian.
With that point out the way let’s look at India. Islam arrived in two different ways: through trade and invasion.
The first Muslim incursions into modern day Pakistan came in the 8th century, establishing Umayyad rule in Sindh, however it really wasn’t until the 11th century that Muslim dynasties made large gains in India. This was done by three successive Turkic states called the Ghaznavids, the Ghorids and the Delihi Sultunate. The first two ended up controlling northern India while the latter ruled most of the subcontinent. All three of these states were conscious of their vulnerability as interlopers and saw no reason to annoy their subject populations by forced conversions. While there were certainly several incidents of religious persecution the Delhi sultans ultimately needed Hindus to make their Empire run smoothly. It should also be pointed out that medieval India’s population numbered in the hundreds of millions. Islam in India took on a distinctively Indian form, and became one more faith in the diverse religious milieu. Merchants spread Islam, especially Sufi Islam far and wide, notably Bengal which today has one of India’s highest Islamic populations but is distant from the historic centres of Muslim power. While many people were converted willingly, Islam had little appeal to high caste Hindus who would loose their social status. A problem that Christian missionaries up to the present day also encounter.
Sufi Islam in its Indian form entered into dialogue with Hindu traditions and became largely pluralistic in its outlook. At the court of India’s last Muslim Empire: The Mughals Islam was seen as one aspect of an eternal truth rather than having a monopoly on it. The Mughal Emperor Akbar removed all restrictions and invited thinkers from all known religions to debate with him. One consequence of this was Akbar’s founding of his own religion: the Din I Ilahi which he intended to contain the truths of all religions.
Even Aurangzeb the notoriously conservative Sunni Mughal Emperor had thousands of Hindu officials in his army and bureaucracy. Aurangzeb probably wished he could convert all of India to Islam. Though even for one of the most powerful people in the world, this was not practical.
Edit: removed short paragraph on Zoroastrianism which requires fact checking.