Why does China want Taiwan?

Yes of course.

There is almost certainly no piece of inhabited dirt today that’s been under the same or legitimate predecessor government since before there were governments. IOW, every bit of inhabited land has changed hands badly at least once and in someone’s eyes the current occupants can be considered illegitimate squatters.

All that differs is how long ago the dirt last changed hands illegitimately and how much the former occupants have labored diligently to keep that grudge alive across the ages.