The Religion Factor
To understand this, you have to understand Hinduism. Let me take up my own case- a Kokanast Maharashtrian Brahman. This is a sub-caste. The point of interest to us here is the amazing similarity in diversity in India.
Hinduism (Sanaatan Dharm) is an individual, a highly individual religion. it is common to have the Father worship Lord Hanuman, the Mother Worship Lord Ganapati, the Son to worship Maa Durgaa, and the Daughter to worship Lord Krishna. No one forces anything on anyone; there are no dictats or dogmas; no specific days to attend, and compulsion to pray. It is an individual choice.
Further, beliefs of Hinduism have roots deep in the ancient past - going back 6000 years and more. This means a deeply-set range of beliefs and attitudes, mores of behaviour, cultural traits etc that are totally different from any other religion. Thus, only the downtrodden can be a realistic target for religion change. General change from the local populace is not a consideration.
However, the downtrodden also have historically enjoyed total freedom to worship the Lord of their choice. They, too were never under any compulsion; they were persecuted - true, but persecution was not on praying; it was on praying in the higher-caste temples. Thus, they had no basic complaint against the religion per se, only the overall societal structure.
The Caste Factor
We have seen the nature of Hinduism, and its amazing diversity and total individuality. And yet, strangely, within this individualism is hidden a strange cohesion that is stronger than any known religious bond. Coming to myself, we kokanast brahmans, exhibit some peculiar traits that are identified with us: stingy behaviour, general reservedness in family functions (our functions are rather small affairs), tall, usually fair, our functions are rather contained affairs. Contrast this with the other main Brahman sub-caste in us Marathis: The Deshasth. These people are lively, you will find their functions full of energy, gift-giving, deep and extensive contacts. This is indicative of a deep cohesion due to in-breeding; the preferred match for a Kokanast is still a Kokanast even in the 21st century.
The point is that this is 2012, and nothing substantial has changed. if we are so cohesive now, what must we have been like 1000 years ago? in 2003, I shaved my moustache: and believe you me I got dirty looks from quite a few family members who gave me hell. These essentially caste-internal interactions create a deeply connected society, and this acts as an extremely powerful support base against as well as protector from subversive change. An individual has to after all live in the same society. Add to the the inherent religious freedom, and deep-rooted cultural and religious ethos. This cohesion combined with total individual freedom is further complicated by difficulties in marriage even today. In the old days. this must have been compounded by career and vocational hurdles as well. This creates a further barrier to change, keeping the religion intact
This factor means that there is societal pressure from within each sub-caste not to change; while no one will object to your decision, no one will agree to marry you (or you will find difficulty in getting a suitable match within your community). Further, the caste also pressurises in subtle (as well as not-so-subtle) ways the family members. In my case, Dad lowered the paper, gave me a look (no moustache), and raised the paper again without a word. Mom glared (apparently, only fatherless people shave off moustaches). This is modern india we are talking about - the case of an Army Colonel, MD in Anaesthesia, Mom being a post graduate gold medallist, sister a gynaecologist, self a postgraduate, and brother a graduate. Well, after Mom-Dad were taken away to the heavenly abode, I attempted it again - and told my wife. Her response to my no-moustache declaration of independence (I was on tour): so you are away for 3-4 months now? My wife is a double Postgraduate in Economics. And this is in the case of a moustache. Just imagine the reactions in case of religion! This is modern India, AD 2012. A family I know has one condition for a match for their son: the girl must be fluent in Marathi.
These, and innumerable other societal pressures still operate in India. What do you think it must have been like in 1400AD? Such pressures both insulate the individual as well as erect powerful barriers to change. You see, for a Hindu, worshipping a different deity is one thing; changing your religion quite another
The Historical Perspective
Yes, there was persecution by Muslim invaders. But the people to change their religion were, by and large, the downtrodden who had a powerful motivator to change. And even among them, change was restricted to a percentage due to the caste factors and religious factors discussed above. Then, the invaders were on a mission to rule, and loot. The objective was not conversion, it was a byproduct. The noblemen and ministers in the medieval muslim rulers' courts were totally turks and other muslims from outside India. Even local muslims were not included; both local hindus and muslims were treated with contempt. India was already home to a sizable muslim community by the time the invaders arrived; the earliest Muslim community in India dates back to around The Prophet's time (The Mopillahs). Furthermore, India had massive trade links through both Sea and Land routes to the Muslim world, and there were already muslim settlers who came for trade in the Northwest, and a few other isolated pockets. Yes, conversion also happened, and is good numbers, as discussed above. Further, the main interest areas were cities for the invaders and rulers, rural India was not touched by some of these developments
Thus we can see that the interaction of these three forces ensured that India remained a predominantly Hindu country.
As regards the British non-attempts to convert, that is a myth. It is a documented fact that the British had a) full intentions to go on a massive conversion drive and b) populate India with Europeans. A note to this effect was known to have been raised in the late 1840s. This is a matter of documented record. That this did not happen is largely due to The First War Of Independence 1857 - 1859.
The longest attempted conversion was the Goa Inquisition, for a continuous period of 200 years in full brutality. Despite this, a large segment of Goanese remained Hindu - nearly 40 - 50%.