Ukraine was an officially recognized sovereign nation by Russia. Its the 2nd largest nation in Europe by area with several NATO nations on the border. This can get out of hand. Ukrainian refugees will begin to populate cities, towns, and villages in bordering NATO nations. Its already happening. If Russia is able to occupy Ukraine a resistance will develop. It will develop and work in and out of these nations borders. Smuggling arms across those borders to send Russian occupiers home in body bags.
Policy and a defense treaty are two different things. We do not even officially recognize Taiwan as a independent sovereign nation. China has always asserted its part of China. The US handsomely provides arms for Taiwan but is under no official contractual obligation to defend it if attacked. This is why Boris Johnson is running around wanting to expand "NATO" type agreements in Asia.
Justin can ready the China-Taiwan thread.