“Is Taiwan possessed by evil spirits?” demanded the Kuomintang (KMT) party presidential candidate Han Guo-yu after a military helicopter crashed last week, killing eight military personnel on-board. The bombastic and confrontational Mayor of Kaohsiung is challenging the incumbent Democratic Progressive Party (DPP) leader of Taiwan, Tsai Ing-wen for the presidency. Superstitions run deep on this self-governing island, yet Han’s blatant attempt to exploit a national crisis to attack Tsai for bringing Taiwan “bad luck” has been the latest in a series of distasteful gaffes that will likely cost him the election.

Taiwan goes to the polls this weekend in presidential and legislative elections that will determine the future not only of its 24 million inhabitants, but also play a decisive role in the rapidly deteriorating relations between the world’s two superpowers. While Beijing explicitly backs the KMT, Washington’s foreign policy establishment unofficially favours the DPP.

For the Chinese Communist Party, Mao Zedong’s victory over Chiang Kai-shek’s Kuomintang continues to be the founding historical narrative upon which the party’s political legitimacy is based. Chiang and his army in 1949 were forced to retreat to Taiwan, where the KMT ruled until the island elected its first DPP president in 2000. Beijing’s memory of Mao’s victory is tarnished by this loss of Taiwan. Every Chinese leader since Mao has supported the cause of re-unification with Taiwan, but none as vociferously as Xi Jinping. He has made re-unification a central goal for his presidency, intermittently dispatching warships to pass through the Taiwan Strait to demonstrate his intent.

Any move to bring Taiwan back into mainland China would entail a long and bloody war that would inevitably drag the US and possibly Japan and Australia to the island’s defence. Despite Xi’s speeches declaring the CCP’s preparedness for reunification, Beijing are not yet ready to endure the costs of reunification.

Beijing cannot rule Taiwan directly, but it indirectly exerts influence by meddling in the island’s elections. For China, the KMT’s support of the “One China Policy” is more palatable than the DPP’s pro-independence stance. The KMT advocates the existence of one China, but accepts that Beijing and Taipei differ on interpretations of which territory holds that title. By contrast, the DPP advocates a future as a sovereign state that sheds any association with China.

Beijing interferes in Taiwan’s elections using a mixture of covert and overt methods. Many of Taiwan’s TV channels and newspapers receive funding from mainland state-run organisations, while its social media is awash with China-generated fake news stories that discredit DPP candidates and generates positive headlines about the KMT.

China rewards Taiwan if they elect pro-China presidents, by boosting cross-strait trade and investment, as well as promoting tourism to the island. When it elects a DPP President, Beijing restricts economic exchange, with the aim of undermining their economic record. In August last year, to punish Tsai for her support of the Hong Kong protests, Beijing blocked all individual travellers to Taiwan. In response, Taiwan’s tourism board initiated an advertising campaign touting itself as one of the few places that did not have Chinese tourists.

The emerging political formulation is of the KMT as the party of economic pragmatism, supporting closer ties with Beijing to benefit from China’s trade and investment. Meanwhile, the DPP puts its political vision for an independent Taiwan ahead of cosying up to the mainland. The DPP’s electoral appeal rises in tandem with the perceived threat from Beijing and the argument for greater independence from the mainland trumps the appeal of Chinese capital.

The protests in Hong Kong last year shifted this interplay between political and economic imperatives in favour of the DPP. Hong Kong owes its modern wealth to China, yet its citizens are still pushing for independence from its rulers in Beijing. They are demanding democracy and the right to a distinct cultural identity, both of which Tsai reminds voters are both new and fragile to Taiwan. The island first directly elected their president in 1996, while Hong Kong’s Chief Executive remains indirectly selected by a pro-Beijing body.

This time last year, Tsai’s re-election prospects looked bleak. The DPP had just suffered a series of stinging losses in local elections throughout the island, including the post of Kaohsiung’s Mayor to Han Guo-yu, who booted out the DPP incumbent. In the aftermath of that election, it seemed inconceivable that Tsai would win another term. She resigned as DPP party secretary and her deputy William Lai challenged her in the DPP presidential primary. Yet support for the DPP has surged off the back of the protests in Hong Kong, as well as revelations from a former Chinese spy who recently revealed that he was hired to meddle in the Taiwanese election.

Han’s presidential bid has been beset by embarrassing political gaffes and the inability to shake off the impression that if elected, he would work in the best interests of China rather than Taiwan. Han is in many ways a skilled campaigner, attracting throngs of adoring fans to his rallies and coming up with pithy campaign slogan such as his pledge to end Kaohsiung’s fate as an “old, poor and ugly” city. But the persona that appeals to disaffected voters also has a darker side; he gained notoriety in the early 1990s after punching a former president in the parliament.

If the polls are correct and Tsai wins a thumping majority against Han this weekend, the KMT’s inward soul-searching will likely conclude that their controversial candidate is to blame. But the party’s problems run far deeper than Han. Its natural supporters tend to express greater affinity with China, yet they tend to be from the generation born in a tumultuous period of history, when the future of both China and Taiwan was yet to be determined. Young Taiwanese are shedding their ancestors’ dream of reunification with the mainland and do not see themselves as culturally Chinese. For the KMT, losing this election will be indicative that their core political vision is losing traction on the island, rather than mere bad luck.