Taiwan had been part of the Chinese Empire for about two centuries until 1895. It was then conquered by Japan and remained a Japanese colony until 1945.
After World War II, Chiang Kai-shek’s Chinese nationalists settled on the island after losing the civil war in China to Mao Zedong’s Communist Party.
China sees the island as a (renegade) province, but the Taiwanese government considers itself independent under the name Republic of China. Few countries recognize Taiwan as a sovereign state. Most countries formally adhere to the one-China policy and don’t want to offend Beijing.