India was a collection of many many smaller kingdoms when the British came to the scene. There was a whole bunch of infighting and backstabbing going on which the British happily encouraged and exploited.
It is definitely amazing that they could do what they did, considering the sheer size of the country.