In the first place you cannot compare gdp in 2 different currencies without accounting for inflation.
Why is it surprising India has a large economy? They have the largest population in the world. Just by eating, shitting and drinking, they generate a lot of market share.
Through we can certainly discuss if gdp is a good measure at all.
After all, the Qing empire had a larger gdp than the British empire up to during the 2nd opium war. At that time, the British had over 4 times the productivity in steel, had far more efficient infrastructure and could produce goods at much better rates.
Imo what provides a more accurate picture of economic size is a combined comparison of: Basic resource production (i.e. steel) + energy output + advance goods production (for example, cars, electronics).
But even in these metrics, there is a clear gap between China and US. There is basically no metric one can use that wouldn't land China on the no1 spot. Well, unless you start measuring "economy size" through number of incarcerated and executions...
China is the 'world's factory', where local people can buy everything of domestic origin in yuan (apart from some non-essential luxury type goods only), not from abroad in dollars, so they don't lose anything on the 'bad' (intentionally made by them) exchange rate of dollar/yuan rate. And they buy things 10 times cheaper than Westerners in terms of prices, from the start, due to the far more advanced industry.
Not to mention how nominal GDP simply doesn't do anything to factor for simple yearly inflation (rising in prices doesn't equal more productivity). Even GDP PPP is a silly indicator for China because Western GDP PPP is mostly made up of irrelevant services, GDP PPP for countries of the Global South is mostly made up of raw material exports, while Chinese PPP is made up of heavy industry on which the whole world depends, which is the most valuable in the world. So, the structure is very important, and China's GDP structure only promises more innovation and growth.
China may have a GDP per capita 10 times smaller than Spain's, but as they are world leaders in industrial production, they can buy air conditioners, refrigerators, stoves, and other household appliances 10 times cheaper than in Spain (hypothetical ratios). A country with the most 5G internet and high-speed trains in the world can hardly be compared with India and other Global South countries in terms of individual living standards.
The Chinese economy uses half of the world's steel and other industrial materials annually (cement, aluminum), and on top of that, as the world's largest producer of these materials, it shows what an industrial power they are and the real strength of their economy (industry) much better than just GDP which includes all sorts of irrelevant services from the West and exports of ores and agricultural products on which the Global South lives.
China produces 60% of the world's household appliances annually, as well as the majority of cars, phones, TVs, furniture, etc. So, it doesn't matter what their GDP per capita is when their citizens benefit from a domestically developed industry to get all these things at 10 times lower value than in the West or the Global South.
China today has more middle class than the USA and almost more than the entire EU. In terms of total median wealth, they are above the European average (without even considering the income/expenditure ratio).
And all this with 40% of the population still in rural areas and with poorer education. Imagine in the future when they also urbanize and specialize further. Even though their middle class has a lower nominal GDP per capita in dollars, it's absolutely unimportant when they don't buy anything from the West to change the exchange rate, and their domestic industry is 10 times more developed, so they get things 10 times cheaper due to "economics of scale".
The Chinese are now the biggest buyers of iPhone and Tesla in the world, buying more than Americans, even though these brands are not even the first choice for the Chinese population. Look at how many calories the Chinese consume annually, and how much meat they consume annually, more than most Western countries. Life expectancy is also higher than in the US, better literacy rate, etc.
I forgot to add how in China residents have free education, healthcare, transportation, and free accommodation if needed for the homeless (none of this exists in the West, especially not in America). And how their state-owned companies do the extraction and processing of energy resources, not their private companies, so they also have much cheaper bills for electricity, heating, and water...
Not to mention that they import cheap energy resources from Iran and Russia (unlike the brain-dead EU), and do not have a green agenda, like all zombies from the West which further raises the overall inflation level of an economy. All this contributes to their expenses being so much lower compared to the West, making their standard better. Their expenses are far lower than in the West than their incomes are lower than there, so the ratio (the real standard of living) is distorted if you don't look at it like that. Great answer btw, steel and energy are truly everything.