That's a different question and I think the answer to that is obviously complex, but a lot of it is luck. If the Dutch and Portugese had shown up in the Indian ocean while Ming were still engaged, they would have had a rude shock. Otherwise, historians have looked at factors like the location of iron in China (further from population centers) and timing of major epidemics. One really interesting book is
https://global.oup.com/academic/product/before-european-hege...