The East India Company, and then the British Raj, held power because they were able to broker deals with opposing (and warring) princely states and kingdoms. They used contractual leverage to make those sub-sub-regions keep each other in check.
The British Raj was a kingdom of kingdoms, in addition to being a protectorate. These are literal legal facts [0].
The word Hindu is literally an exonym. A name given to a people by foreigners. Our very collective identity was conferred upon us by outsiders.
[0] Obligatory Wikipedia... https://en.wikipedia.org/wiki/British_Raj#British_India_and_...
In its Interpretation Act 1889, the British Parliament adopted the following definitions in Section 18:
(4.) The expression "British India" shall mean all territories and places within Her Majesty's dominions which are for the time being governed by Her Majesty through the Governor-General of India or through any governor or other officer subordinates to the Governor-General of India.
(5.) The expression "India" shall mean British India together with any territories of any native prince or chief under the suzerainty of Her Majesty exercised through the Governor-General of India, or through any governor or other officer subordinates to the Governor-General of India.[1]
Who agreed to the legal terms? The rulers of the sovereign princely states and kingdoms.