It's a bit weird but it shows that Taiwan's situation isn't that special regarding TLDs.
As the remnant of the side of the civil war that lost, they call themselves the Republic of China. They claim as territory all of China and more, including parts that the PRC has since relinquished.
There is an 'hk' TLD and an 'mo' (macau) TLD and they don't seem to be going anywhere for the time being.
The claim that 'tw' would be removed is just unfounded conjecture or FUD in my view.
There are two countries claiming the title of "country of China", the PRC (holding the power on the mainland) and the ROC (holding the power on the island of Taiwan). Both insist there is only one "country of China", and of course both are insisting their respective regime is the one that should be governing it. None of the two suggest there is "a country of Taiwan". Indeed, the PRC "has been repeatedly affirming" that the other guys' state is "not a country, but is actually a rogue province and fully part of" themselves, but so has ROC! For the ROC, the mainland is actually a set of "rogue provinces" as well, and, somewhat amusingly, this also includes the "rogue province" known today as the country of Mongolia.
The support for two independent countries (China without Taiwan, and separately Taiwan without China) is less than non-existing on the continent (to put it mildly), but (to the best of my understanding) in the last years has some support on the island.
Basically we are a big old database. When someone registers a new domain, via a registrar, they send us that information (most commonly via a protocol called EPP). So we get "this is the domain, registered by this person, it has these hosts, it is registered for this long, with these DS posts, for example. Different registrys have different rules, for example the .se domain has a set of allowed characters that you are allowed to use in your domain name, and rules on how long into the future a domain can be registered for.
This data is then used to perform our most important job as a registry. Creating the zone file for our TLDs so that people could actually reach the domains.
That is from the technical side. There's also a big support side with different aspects. There are abuse issues that need to be taken care of, ICANN has a dispute mechanism that people are involved in.
ccTLDs though are much more like special snowflakes though. There's a large difference in policies, features, technical implementations, etc., from one ccTLD to another.