Chiang fled to Taiwan wasn’t Taiwan
considered part of China?
Taiwan had been under Japanese rule for 50 years. When Japan lost the war, Taiwan was governed by the Allied Powers, who appointed Chen Yi [1] from the Kuomintang (KMT) as chief executive and garrison commander of Taiwan Province [2].The Peace Treaty with Japan (Treaty of San Francisco) [3] and the Sino-Japanese Peace Treaty (Treaty of Taipei) [4] both did not specify that Taiwan was a part of mainland China. I think formally/legally Taiwan was Japanese until 1952 but Japan was under allied control now. The question of Taiwan's legal status was left open in the aforementioned peace treaties. This is the legal/technical root cause for the problems with Taiwan's legal status even today. (The real reason is quite different: it's Taiwan's thriving democracy which undermines and contradicts the Chinese Communist Party narrative that democracy is neither needed nor desirable for the Chinese people.)
The administration of Taiwan under Chen Yi was strained by increasing tensions between Taiwanese-born people and newly arrived mainlanders. Even back then, many Taiwanese resented the increasing streams of mainlanders coming to Taiwan as the Chinese Civil War raged on the mainland. This culminated in the February 28 1947 Incident [5], which cemented the KMT's rule.
[1] https://en.wikipedia.org/wiki/Chen_Yi_(Kuomintang)
[2] https://en.wikipedia.org/wiki/Taiwan_Province
[3] https://en.wikipedia.org/wiki/Treaty_of_San_Francisco
In the 17th century various European powers (Spain, Portugal, Dutch) sought to dominate Taiwan, but were eventually expelled, when the Qing dynasty (the last imperial dynasty of China) annexed Taiwan in 1683. That rule ended with the Qing's defeat in First Sino-Japanese War (1894–1895) [1]. Taiwan was ceded to Japan on 17 April 1895.