India has some of the highest ranked universities in the world.
Whose capacity is close to nothing for the population. Indian universities fall in two categories: really good ones or absolute shit ones (source: I'm an Indian). There is no middle category. To get into the really good ones, you have to either have an exceptionally good academic performance or have to be extremely rich. Universities outside India fill in the demand of this middle category. Sprinkle in some permanent emigration aspirations and you get a country with a large emigrating student population.
It’s a country famous for putting out doctors.
While it is true that this is the perception of India especially in the west, it is categorically untrue. According to the World Health Organization (2023), India ranks very low in the amount of doctors per 10,000 people relative to developed countries (by more than 300%). If you counter this by saying "this is because all Indian doctors emigrate to the said developed countries", then that would be incorrect again, as around 10% of Indian physicians emigrate and practice in the west.
And don’t forget that a large number of foreign students is also a product of just having a large population.
I believe you are pinning "a large population" as the causal factor behind a high student emigrant population. Had this really been a causal factor, then we would've seen European and American students in Indian Universities proportional to their population (which when combined, makes up around half of India's population). The fact that we do not observe this phenomenon is evidence enough that "a large population" is not the causal factor behind this. Rather, it is the access to good education which plays a much much larger role.