“When you say the Republic of China, there is the word ‘China’ in there as well,” said Ms. Zhou, speaking during a lull between boisterous groups of visitors touring the cave. “Chiang Kai-shek came to Taiwan from the mainland, too. I think a good leader needs to seriously ponder if he or she wants Taiwan’s economy to develop and its people to have stable lives.”

Kinmen County prospered as ties between China and Taiwan deepened. In 2001, passenger and trade traffic began between Kinmen and Xiamen. Seven years later, all of Taiwan opened up direct air, sea and postal links to the mainland. The population here boomed, surging to more than 133,000 this year from fewer than 80,000 a decade ago.

Tourists from the mainland arrive by boat in Kinmen’s port, and a much larger port is being built adjacent to it. A six-story shopping complex, catering to mainlanders and billed as Asia’s largest duty-free mall, opened in 2014.

On Taiwan, an hour’s flight away, there has been a different narrative. The economy is contracting, and voters who cast their ballots in January, wary that closer ties with China were draining the island of some good jobs and giving Beijing more influence, rejected the party that brought better ties with the mainland, Chiang’s own Kuomintang, or K.M.T. The newly inaugurated president, Tsai Ing-wen, leads a party swept into power partly because of concerns about China’s growing shadow over Taiwan.

In December, Ms. Tsai made a campaign stop in Kinmen, one of the few counties that her Democratic Progressive Party wound up losing, and pledged to pour more resources into developing the small islands. As the former head of the government agency that oversees ties with the mainland, she was one of the architects of the “mini three links” that in 2001 opened limited passenger, trade and mail connections between Kinmen and Xiamen, and she is not expected to alter the status quo that has given such a lift to the local economy.

Despite decades of being on the front lines, including an artillery bombardment that extended over two decades, people on Kinmen see the mainland not as a threat but as an opportunity.