China didn’t collapse in 1989 because they were the only communist regime able and willing to massacre protestors.
From my naive observation, the regimes of Eastern Europe had lost their will to perpetuate. (Everybody saw, including party apparatchiks, that the people in the west have better lives. Or at least better goods. :-) )
The cynical take would be that the (smarter) communists in power prepared themselves for the transition, positioning themselves to benefit after the change.
Taiwan's GDP/capita is 2.6x China's [1]. It grew faster, for longer, in large part through high technology.
Counterfactuals are always hard in history. But we literally have the nationalist government's democratic, capitalist successor kicking in way above its weight class economically and technologically. It's fair to say that if the '89 protest hadn't been massacred, the 21st century would currently be undoubtedly China's to rule. (I'd also put even odds on Taiwan having peacefully reunified by now.)
[1] https://countryeconomy.com/countries/compare/taiwan/china?sc...
Also worth mentioning, all the while being under a military dictatorship (see White Terror) until the late 80's.
From your link: 1987: Taiwan 5325, China 300 1996: Taiwan 13588, China 710 --- 2024 Taiwan 34060, China 13314
Whatever starting point you choose, China has risen faster than Taiwan.
In fact, there is non-zero chance that if China had a regime change and heeded west's economic 'advice', it would have gone through equivalent of what Russia went in the 90's.
They are doing fine, thank you, doing it their commie way, despite Zeihan and others preaching China's immminent collapse for decades.