Taiwan was not part of the Chinese empire until 1683, and that was only because Chinese had been moving to the island since the 1200s and, by the 1600s, were numerous enough to dominate the native population. The Chinese empire ruled Taiwan until they transferred it to Japan in 1895 after losing a brief (about a year) war with Japan. The Japanese managed Taiwan more efficiently than the Chinese and by World War II the Taiwanese were generally pro-Japan. This was noted when American military planners were ordered in 1944 to prepare a plan for invading and conquering Taiwan, to use it as a base for warplanes bombing Japan and Japanese troops in China. General MacArthur was commanding forces approaching from the south and pointed that the Philippines would be easier invade and conquer than Taiwan while achieving the same strategic objectives. American military planners found that MacArthur was right. Taiwan was and is a nightmare for anyone staging an amphibious operation. The island is only 394 kilometers long and 144 kilometers wide at its widest point. The terrain is rugged with 258 mountains over 3,000 meters (10,000 feet) high. Many key highways are built in the many valleys and that creates a lot of narrow choke points that can be easily defended, often with the help of tunnels dug into nearby hills and mountains. This makes it very difficult for an invading force to get off the beach.
Taiwan has few (about a dozen) useful invasion beaches and lots of high ground behind those beaches. Since World War II the population quadrupled to 24 million. Most live in built up urban areas and this is a nightmare for any invader because all those structures favor the defender. Taiwan has built several air and naval bases that make use of tunnels built into nearby mountains. Many urban areas have built tunnels to protect the population during major storms, and soldiers during an attempt to invade and conquer the island. Taiwan is also surrounded by about a hundred small islands, most of them uninhabited but large enough to support some troops armed with artillery and anti-ship missiles.
The unique geography of Taiwan is one reason why post-World War II Taiwan emphasized manufacturing and a highly educated population. That led to Taiwan becoming a major provider of electronic and other high-tech items that most industrialized nations, especially China and the United States, depend on. If China seeks to conquer Taiwan, they must avoid destroying the many areas containing manufacturing operations that the Chinese economy depends on.
Currently, Taiwan can confront any invasion with nearly half a million troops. While the active-duty force is only 190,000, Taiwan has two million men with military experience in the reserves and 10-15 ten percent of these are kept at a higher state of readiness to quickly join the active-duty forces in the event of an invasion. Most of the men in the reserves are former conscripts who serve four months of active duty when they turn 18 and then continue serving in the reserves until they are 36. As the Chinese invasion threat increased over the last two decades, reserve duty has been regarded as more essential to the survival and an independent and more prosperous (than China) Taiwanese democracy. This means that more reservists are willing to continue serving after 36 and this increases the number of experienced men in the reserves. Taiwanese see themselves as an island version of Switzerland, Israel or Sweden, all of them dependent on a large, well trained, reserve force to deal with any invasion. These three Western nations have used this mobilization system very successfully, for centuries in the case of Switzerland. China noted how rapidly mobilized Ukrainian forces defeated a 2022 Russian invasion. Ukraine is largely flat terrain with some rivers to provide defensive barriers. But nothing beats an island with few invasion beaches and lots of mountains defended by a well-armed and determined population.
The current Taiwanese reserve system was developed in the last two decades and there is little public data on how well armed and equipped the reservists are. Switzerland has long mandated that reservists keep their rifle (now assault rifle) and ammunition at home. This has worked. Heavier weapons are kept at numerous storage sites throughout the country. Taiwanese military spending has grown considerably over the last six years and a lot of that has gone to the reserve forces to increase the ability to put armed reservists into action more quickly.
The increased military budgets have also improved intelligence devoted to the Chinese military and what they are capable of. This also involves dealing the growing Chinese use of spies and Taiwanese military officials who have been bribed or blackmailed into secretly working for China.
As a democracy, Taiwan gets a new government periodically and some of those governments are more supportive of defenses against Chinese invasion than others. Since the 1990s the Chinese economy has grown enormously and that was done with the help of existing Taiwanese firms looking to expand into China. That gave China an opportunity to influence Taiwanese politics and elections. The influence is currently less effective for China because most Taiwanese realize that China is determined to make Taiwan part of China once more. Most Taiwanese agree that this is not desirable and as long as the Chinese insist on submission, Taiwan will have to maintain its defenses.