Continue....
So after describing all that, I can get to why I think you are wrong to equate raw numbers = comparative advantage/bigger market.
First, larger number of people does mean a larger market in general since there are more people to consume but the pre-requisite is that the population of this market can consume. No-one would think that China could be anywhere near what it is today in 1980s, primarily because, although there was a huge population there were not enough people with the ability to consume much, other than maybe the cheapest of goods. There was a conscious effort by China gov to move things in the direction they wanted, instead of just leaving everything to the free market.
Second, advancements, this would be the greatest factor as to why India despite its huge population may have problems in the near or longer term future. The buzz word
Automation, isn't just a buzz word anymore. There are significant advances in automation over the last 20 years and it has arguably moved more than the advances that has happened, from the time of first industrial revolution to the year 2000.
We are at an age where factories can literally run 24/7 without further human input after setup, barring repairs and troubleshooting. This is further accelerating as technology continue to advance. As technology advance, the cost of setting such a factory will continue to lessen over the years.
Manufacturing as a driving force of poor economies to rich economies is getting closer and closer, to coming to an end. This is not some doomsday fortune telling but the literal changing environment we are living in. I am pretty sure you can understand the meaning behind this.
Third, like
@Hendrik_2000 said, population is as much a burden as it is a blessing. Aside from feeding the population, which in turn necessitate industries to do so. The bigger problem in the modern world is providing jobs, an economy ultimately runs on consumption of goods and services, if you cannot provide enough jobs for the population then no matter how big your population is, it is useless to the country and is a burden instead. This also create class disputes and destabilizes the country from within. This point reinforces point 1 above and will be further exacerbated by point 2. No matter how cheap manual labor is, once automation reaches the point of no return, machines will take over the manual labor. They don't need rest, time to eat or drink, they can preform the task with greater precision with faster time. It is no longer a matter of how or ifs, it is only a matter of time. A larger population without the ability to work is no use at all.
Fourth, the dream and,
yes the dream, of forcing major sections of manufacturing out of China is ridiculous as least for the foreseeable future. The reasoning is simple, China isn't just the factory of the world but also it's supply chain. Manufacturing in China means you have pretty much all the supplies you need, from land needed for factories, raw materials, to machinery, to machinery components for repairs, a ready made work force, an advanced and educated work force, most of the world automation advancements, an unbeatable infrastructure network and a consumer base ready and willing to consume, need I go on. What more could a manufacturer ask for. You can go from designing, to prototyping, to refining, to manufacturing and to selling all in one place. prototyping and refining designs would be cheaper than anywhere else as well, considering the all the components or the ability to manufacturing the components is already there.
In the long run, if India doesn't get its act together and soon, it may never have the chance. The Made in India campaign was a case in point, of the inability or unwillingness of the Indian state to facilitate the advancement of the country, and the nationalist sentiment is only making it worst, not better. India will have to swallow it's pride and accept made in china goods for now, if not end-products then machinery and components and maybe even skills/skilled labor to teach them, otherwise they may not have the choice in the future. The time of no return is closing in on them and they are concerned about boycotting China and dreaming about their place in the world, whilst they should be working on transforming their industries not as a free market but as a gov lead centralized effort. Without the necessary reforms India will not be a desired market anytime soon in the future, but merely a dumping ground of irrelevant and unwanted tech, be it weapons or manufacturing machinery.
At least, Iran with all it's sanctions and limitations can still produce their own military equipment, what of India, open the markets of the world and barely able to produce a fighter after 40 years, a tank after 30 years, missile with massive Russian input and most of all, they can't do without foreign components for any of the so called indigenous equipment.
So spare me the numbers argument, comparative advantage and market size is not as simple as merely the number of population. And for the ideal population of China, one that balances burden and blessing, there is no set number and it is more to do with situation at hand.