HER VICTORY was expected but not, perhaps, its margin. Tsai Ing-wen, Taiwan’s president, won a second four-year term in a landslide on January 11th. She drew over 8m votes, more than any candidate has received in any of the seven direct elections held since 1996.

Ms Tsai, Taiwan’s first female president, scooped 57% of the votes cast, against 39% for her main opponent, Han Kuo-yu of the pro-China Kuomintang (KMT). A third candidate, James Soong, also seen as pro-China, took around 4%. In simultaneous elections for the island’s parliament, the Legislative Yuan, always likely to be much tighter, her Democratic Progressive Party (DPP) won with a reduced majority. It will have 61 of the body’s 113 seats, down from 68.

Ms Tsai’s triumph will infuriate China, which claims Taiwan as its own territory. Ever since she took office in 2016, it has been doing what it can to put pressure on voters to reject the DPP, which has traditionally favoured independence from China. To this end, China has staged military exercises, including bomber-jet flights near Taiwan, and waged a diplomatic campaign to isolate it internationally. Since 2016 it has poached seven of the developing countries that give diplomatic recognition to Taiwan, reducing their total number to 15.

The campaign seemed at first to be working. Just over a year ago, Ms Tsai’s popularity was dwindling. The DPP took a thrashing in municipal elections in November 2018 and she was forced to step down as the party’s chairwoman. Two factors help explain the turnaround in her political fortunes since then.

Perhaps most important was what has happened in Hong Kong. In January last year China’s president, Xi Jinping, made a speech reiterating its long-standing carrot-and-stick approach to Taiwan’s future: the promise of a version of the “one country, two systems” formula it uses to rule Hong Kong; and the threat of military invasion should the island take steps towards formal independence.

The outbreak in June of months of sometimes violent unrest in Hong Kong’s reignited fears in Taiwan about its possible future if it did not elect a leader trusted to protect its sovereignty. Ms Tsai successfully capitalised on this, and her approval ratings soared. Her opponent, Mr Han, campaigned on a platform of enriching the island’s economy through closer ties with China. This enabled her to portray him as untrustworthy and unable to protect the island’s de facto independence, frequently pointing to a visit Mr Han made to Beijing’s liaison office in Hong Kong in March. The DPP also criticised Mr Han for describing Taiwan, in general terms, as part of China.

“The results of this election...have shown that when our sovereignty and democracy are threatened, the Taiwanese people will shout our determination even more loudly back,” Ms Tsai told a victory press conference on January 11th.

The second factor was a transformation in the economic outlook. Since 2000 Taiwan’s voters have been asked to choose between closer economic ties with China, advocated by the KMT, at the risk of losing the island’s hard-won autonomy, or a more independence-leaning stance pushed by the DPP, carrying the risk of economic marginalisation.

The trade war waged between China and America has changed everything. To dodge American import tariffs, many Taiwan-owned businesses based in China have diversified by investing more in South-East Asia—and in Taiwan itself, where government statistics show that, encouraged by incentives, they have pledged investment of close to $24bn over the next few years. The growth rate forecast for this year, 2.72%, should outstrip that of the other former “Asian Tigers”. For the first time, notes Lai I-chung of the Prospect Foundation, a security-focused Taiwanese think-tank, Ms Tsai’s security and economic policies were aligned. This helped the DPP win support from businesses, normally a KMT bastion.

Nathan Batto of Academia Sinica, Taiwan’s leading research institute, notes that Ms Tsai also won support by proving that she could deepen ties with America, the ultimate guarantor of Taiwan’s security. In 2019, for the first time since 1979, when America switched recognition from Taiwan to China, America and Taiwan’s national security advisers met face-to-face, and America sold Taiwan 66 F-16 fighter jets.

As Ms Tsai had a good year internationally, Mr Batto points out that Mr Han had a bad one at home. He shot to political stardom in 2018, when, after 16 years out of national politics, his folksy manner helped him pull off an electoral upset to become mayor of the southern port city of Kaohsiung. But last year he annoyed locals by taking a leave of absence after just six months in office to campaign for the presidency. Formal proceedings to recall him are already under way. In addition, the KMT’s chairman, Wu Den-yih, provoked an angry backlash when he put Wu Sz-huai, an unpopular retired general who supports unification with China, on a list of nominees for legislative seats that are allocated by proportional representation, making him a shoo-in.

Based on polling, Mr Batto estimates that in 2019, almost 40% of Taiwanese people thought that at least part of their identity was Chinese. Mr Wu and other KMT bosses are expected to offer their resignations this week to atone for the party’s losses. But Mr Batto thinks the KMT, founded in China in 1919, is unlikely to disappear. And Taiwanese doing business in mainland China will always need a party like the KMT to represent them, Mr Batto argues.

It is not clear how Mr Xi will respond to Ms Tsai’s resounding win. Neither Mr Lai nor Chao Chien-min, a former senior China-policy official in a KMT administration, think it will resort to military action or other dramatic moves. Instead, they say, there will probably be more of the same: diplomatic-isolation campaigns and military exercises in the neighbourhood. Ms Tsai can be expected to be at pains not to provoke China. But for many in Beijing, her victory is provocation enough.