It has nothing to do with Britain ruling India. (By the way Britain ruled India for less than 100 years, from 1857 to 1947.)

There were many weak nations who lost against invaders, we were one among them. Following your logic, let's question why India was ruled by Turks (Tughlaqs, Khaljis), Afghans (Lodhis), Mongols and many others?

How you reason why other nations in Americas, Middle East, South, East and Central Asia, and Australia were ruled by outsiders?

I am certain this time your answer will be based on historical dimensions not just on whims.