A propaganda coup, first of all. They have been promising their increasingly nationalistic populace this prize for nearly a century.
Second: They eliminate a very important forward operating base for any future containment of China by Five Eyes & Co.
Third: It's 23 million people who have built an advanced economy. Being able to siphon that wealth will be a massive boon for the CCP and other parts of China.
The rationale for invasion is clear. Particularly if they have calculated they can't or won't be stopped. I know more than a few mainlanders and they all strongly believe that Taiwan and China will be "reunified" within their lifetime.
Edit: Does anyone here care that none of the Taiwanese want to be part of China? Yes, they are the "losing side" of a civil war from almost a century ago. That's completely irrelevant given how long they have had sovereignty at this point. That they are not more widely recognized in the international community is a tragedy. The U.S. is correct to continue to support their independence.