China had never ruled over the island. It called it a province for ~ 7 years before Japan took Taiwan and actually ruled over it. The US was allied with KMT after they took over from the Qing dynasty. And continued to be allies after CCP pushed KMT out. When China attacked Taiwan the U.S. stepped in.