Taiwan has been historically a part of China under several rulers. It has been under China during the Qing Dynasty and the Republican Era. It separated as a result of the Japanese occupation in 1895 and again after the Chinese Civil War ended in 1949.
After 1949, it has been existing as a independent state with a democratic polity.
Qing Dynasty, 1683-1895
During the Qing Dynasty, a small part of Taiwan was initially ruled as a independent kingdom by the name of Kingdom of Tungning. General Shi Lang of the Qing Empire, set up an expedition and conquered it in 1683. The rule lasted till 1895.
Japanese Rule, 1895-1945
During 1895-1945, Taiwan was a part of the Japanese Empire but its population remained overwhelmingly Han Chinese.
Civil War Era in Taiwan, 1945-1949
During the second world war, both parties to the Chinese Civil War (1927-1949), the Kuomintang and the Communist Party made ceasefire agreements.
After the WW2, when hostilities resumes, the civil war again began. Close to the end of the war, the Kuomintang took his entire government and relocated to the island of Taiwan.
Republic of China, 1949 – Present
Taiwan, which is formally known as the People’s Republic of China, has been governing the island as a democratic state.
It has been claimed numerous times as a part of the mainland China by the Chinese Communist Party, but continues to exist as independent state because of its alliance with the USA and its control over the global semiconductor trade.