China has been defeated by force of arms many times in the past 200 years. In fact, it is hard to find a world power that hasn't defeated China at some point in the last two hundred years: the First Opium War, the Second Opium War, Shimonoseki, the Boxer Rebellion, Manchukuo - China was the "sick man of [east] Asia" ().
It was the Shimonesky Treaty that allowed Japan to have Taiwan. The San Francisco Treaty is when Japan gave Taiwan to us although Chiang Kai Shek and 2 million of his Nationalists fled there, while we were busy facing off against Stalin.