You are correct that historically kingdoms were divided on other factors as well, and not just religion.So what is your interpretation?
There was more to Indian subcontinent than just religious differences, the caste and social structure itself had the population divided, there is a reason why India in its current form didn't exist and historically religion plays only a small part of that reality.
British did use all differences - religion, caste, language - to its disposal. Religion turned out to be the most potent tool. Obviously as a colonizing power, Britain did what was good for it.