The 1800s saw many changes to Taiwan as Qing central control faltered and domestic groups began fighting for power. This instability and the importance of trading routes led to attacks by the French, British, and Japanese, before China's Qing Dynasty clamped down on controlling the island in the late 1800s.
Just after solidifying control over Taiwan, the Chinese entered a war with the Japanese and transferred control over Taiwan to the Japanese. Taiwan remained under Japan's control through World War II (WWII). During this time some Taiwanese groups fought this rule and the Wushe Uprising in the 1930s best represented this fight. The aboriginals that led this resistance lost decidedly, but it symbolized that power remained out of the hands of the still large majority of people, the aboriginals
Despite protests, the Japanese extended healthcare, communication, and infrastructure in Taiwan and these changes were well received. Before WWII, war broke out between China and Japan and the Taiwanese were divided on which side to support then and during WWII.
At the conclusion of WWII, the Japanese gave Taiwan to China, but China remained in the middle of a civil war. A couple years later, as the Chinese communists proved victorious in mainland China, the defeated nationalists retreated to Taiwan, much like Ming leadership did centuries earlier.