1 sentence
As for why there was this Japanese colonial period, it was because at that time China lost a war against Japan, and ceded Taiwan to Japan.
Source: Talk Taiwanese Mandarin With Abby · Taiwan’s Tragic History: Colonialism, 228 Incident and the White Terror | English Subtitles (2:46)