By 1900, Japan was the 8th most populous nation in the world
Japan had a greater population than most of the countries it invaded in the 20th century. China was also in a time of civil war and hardly unified:
Japan then became a major power among the warring states of China, backing the dethroned Qing emperor Puyi in the puppet state of Manchuko. As the Japanese empire's forces also included troops from occupied Korea and China, they were quite evenly matched with the Republic of China's numbers.
Throw millions of Americans and Russians into the mix though and you can see why Japan eventually lost their war with three of the most populous nations on earth.