Muslim control over India (by which I mean the modern state of India, more or less) was always somewhat precarious because whatever Muslim dynasty happened to be in power at any given time was guaranteed to be a religious minority ruling over a vast Hindy majority. The Mughal Empire, which ruled northern India, modern Pakistan, and modern Bangladesh for most of its lifespan (although it did expand deep into southern India in the late 17th century), had to manage this problem throughout its history, which led to some interesting developments like Emperor Akbar’s (d. 1605) syncretic Din-i Ilahi movement. But the Mughals also ruled sizable Muslim populations in the Sindh region (modern Pakistan) and in Bengal, so they weren’t entirely without a religious support base.
On the other hand, the sultanates that ruled the Deccan–in central and southern India–were really out on a limb, ruling populations that were almost entirely Hindu. They had a couple of things going for them: these (mostly Turkic) dynasties moved south out of the highly militarized central Asian milieu, so they were excellent fighters, and Islam, which does preach a message of general equality among believers (admittedly, it’s never been perfectly applied), had considerable appeal for people at the bottom of India’s caste system. Still, they were constantly aware of the threat that a serious Hindu challenge might pose to their survival.