In most nations a ruler would practice the religion of the populice of the nation they ruled however in India there was alot of muslim led hindu nations in india. How did this trend towards muslim rulers start and why did it continue?
Before we start answering the point as to how Islamic polities came to be in “India”, and why they survived through this period, it’d be best to define and clarify a few terms.
The first would be the distinction between, and indeed what constitutes, “muslims” and “Hindus” in the first place. “Hindu” is a very broad term currently referring to many different philosophies and beliefs that fall within a “Vedic” framework. It’s important to note that “Hindu” wasn’t a monolithic identity that existed as a binary opposite to Islam [1]. In addition to this, though probably more concrete, “Islamic” identity has been quite flexible as well. In rural South Asia, the distinction between what is Muslim and what is not (and often times what is “Hindu” and what is not) is not very clear, with people of the region often living with beliefs and using iconography beyond that which are typically associated with their religion, even till today [2]. Further, in this answer I’ll focus typically on Mughal rule in South Asia since it’s what I’m most familiar with.
The first reason as to why the Mughals who entered South Asia in the 16th century were Muslim was because they came from a Muslim region; the Fergana Valley. They traced their descent from the famed Muslim warlord Timur, and after humiliation in Central Asia, a prince called Zahir ud Din Muhammad “Babur” established himself in Kabul and invaded the Indian subcontinent, conquering Delhi and the surrounding area from the Lodi sultans Of Delhi (who were also Muslims originally from Afghanistan) [3]. Their success, to summarise very briefly, can be attributed to use of gunpowder and Babur him self. This isn’t to characterise Muslim dynasties as “foreign” in that many native Muslim dynasties arose through out the region, particularly in Kashmir and the Deccan, as well as other places outside of the time frame you specified.
In tackling the point about how this “trend continued”, I assume you mean how these Islamic polities survived as rulers over a population that was not “traditionally” Islamic. This question will require us to question a lazy stereotype associate Islam with today; a static body of jurisprudence. In contrast, the Islam practiced by the Mughals, and many others around the world at the time was, for a lack of a better word, “dynamic”. To summarise, the Mughal Emperor himself was the subject of divine fetishisation [4] as opposed to static jurisprudence (what we’d recognise today as “shariah”). This framework allowed for religion of subjects to not really matter in governance since the ruler was divine as opposed to interpretations of the finer points of what makes a legitimate ruler in framework x y or z. Of course there were elements of a more “traditional” Islamic framework at play, and some emperors were different in their approach to others, but it’s especially important to point out that in so far that Islam was a governing mechanism of the Mughal state, it existed within a framework that wasn’t as “harsh” or literalist as we can sometimes assume Islam today to be.
Another point is the idea of the subcontinent as a “negotiated society”. Being an agrarian empire in the 16th century onwards, the Mughal state did not have the capabilities or capacity to really impact lives as we’re used to today. Governance was achieved through negotiations with local populations, particularly as the Mughals expanded throughout the region. Force was used in demonstrating the capabilities and inspiring fear, but negotiations were just as important; Mughal emperors often took “native” wives, and Mughal officials were used to balancing different cultural forces in the regions conquered in order to attain peace and therefore tax. This quite different from the idea of a governor existing as a force to impose centralisation. This lack of then an official central order and official “Mughal character” meant non Muslims could easily be accommodated in the framework, as there was nothing that defined the inhabitant of the state as being inherently “Muslim”. Jon Wilson wrote a very good summary of Mughal governmental flexibility in his book about Britain in India; “The Mughal political order was based first on submission to the personal authority of the emperor, then on fostering harmony between different groups rather than imposing homogeneity or enforcing compliance.”[5] In essence, the “trend continued” because it was flexible enough to do so.
I hope this very brief discussion on the rise of the Mughals and two (of many) factors which allowed them to accommodate a non Muslim majority in the late 16th and early 17th century answered your question in part. Your question is very large and tbqh is constantly debated. Many books have been written on the subject, and I hope that this clarified just a few ideas you had.
Sources 1- “The Mughal World, India’s tainted paradise”, Eraly, 1997 2- “Beyond religion in India in Pakistan: Gender and caste border and boundaries”, Purewal, Kalra, 2019 3- Baburnama, Babur 4- “The Millennial Sovereign: Sacred Kingship and Sainthood in Islam”, Moin, 2012 5- “India conquered” Jon Wilson, 2016