This is a somewhat shallow and more buzz phrasey explanation of it. China wanted to invade Taiwan long before it became a democracy. And China is adjacent to many prosperous democracies like Japan and South Korea. Not to mention the hundred million middle class Chinese tourists and numerous students who can see the developed democracies with their own eyes.
With Occam's razor, the simple answer is really that they consider it part of China for historical and cultural reasons. Taiwan did the same for many years.
It's really no difference. Even Chang Kai Chek era Taiwan with the little freedoms its people enjoyed was an enviable place next to sparrow hunt era mainland.
Plus there's the whole "it doesn't make economic sense for X to attack" which doesn't seem to have worked anywhere. Ideology seems to not just trump economic rationality in war, but to literally be the only factor.
X can be:
* Hamas
* Hezbollah
* Russia
* Sudan RSF or SAF
* Iran
* Afghanistan
The list goes on. All of these suffered greatly economically due to beginning unprovoked wars (only RSF has any real claim to being attacked, and even then they could easily have halted the fighting quickly if they wanted to)
Well by definition it has worked in all other cases that you have not listed. Also you can't expect terrorist organizations to behave rationally (on a state/geopolitical level) and pretty much all Middle Eastern countries (besides Iran and they aren't 100% committed either) came to terms with the fact that Israel does and will continue to exist. Did that happen due to ideological factors?
I'd say that Russia is the only actual valid example and the economic outcome remains to be seen (unfortunately Russia has been doing remarkable well economically so far..).
If that's your measurement stick why aren't Iran and Afghanistan counted? You can't dismiss whole countries as terrorist organizations, no matter how they behave (China is at least as bad as Iran, for example, they also run a hostage taking business, and only difference in weaponry is that China actually rapidly succeeded in their nuclear program, which the world then proceeded to totally ignore and refuse to discuss. In Iran there seems to at least be the option of preventing them from going nuclear).
Also in both countries both the people that got into power created an economic disaster coming into power, including for 99% of their own faction (everyone except the leadership). Even their competitors, in both countries I believe that means communists, would have created an economic disaster. So it wasn't the taliban or mullahs per se that did it, well it was, but it would have happened due to other ideological reasons than the ideology that won out anyway.
Iran's position is ambiguous, though. There is no evidence that they'd be willing to engage in any full-scale conflict. If it was purely ideological they'd be doing much more than they are doing now. e.g. Hamas is seemingly willing to see Gaza razed to the ground and with a significant proportion of its population killed than concede anything (no semi rational state behaves that way).
This assumes they can do more than they're doing now (without immediately losing control). Frankly, after Russia demonstrated how well they can defend their own border, I'm not nearly as willing to believe states making threats ...
They don't really have a choice a about it though. PRC is basically threating to invade the movement Taiwan decided to renounce its claim on the rest of China.
With Occam's razor, the simple answer is really that they consider it part of China for historical and cultural reasons. Taiwan did the same for many years.