Oddly enough, depending on how one counts the population of Japan around the time they invaded China, Japan and its colonies (mainly Korea) had a larger population than China did, if Wikipedia can be trusted (see
https://en.wikipedia.org/wiki/List_of_countries_by_population_in_1939)
China was not unified in the first half of the twentieth century. Some parts of it were rules by Warlords who did not answer to a central government, but were their own little kingdoms. Add to that the infighting between the Republicans and Communist and you had a country that Japan though was very weak, and could be taken over piecemeal with ease.
Combine that with the fact that China had almost no Navy, armor, or Air force, while Japan had a particularly strong Navy and Air force, Japan did think that China would be easy pickings.
China actually turned into a meat grinder for the Imperial Army during WW2. The Chinese refused to stop fighting, even though they were horribly outclassed by the Imperial Japanese. China, rather like Russia’s fight against Germany, traded land for time, and pulled the Japanese into a long war of attrition. China moved its capital into the interior to the city of Chong Qing, and dug in the remnants of their leadership and industry into the mountains around that city. Aided by the Americans with air support and material China never surrendered throughout the war, even though all of their rich coastal cities were smashed to rubble.
China actually is second only to Russia in casualties in WW2. They were tenacious fighters, although considering Imperial Japan’s treatment of the people they colonized, China knew it was fighting for its life, and was not going to surrender no matter what.