A lot of this distills and clarifies some of the back and forth potentially lost in the above.
In China most of the housing is not built by “the government.” The land belongs to the national government nominally, but it ceded to the local governments in practice. The local governments are highly motivated to “sell” this land to private developers. Note that this isn’t a sale as we would view it in the west; it’s really only a 70 year monopoly right to use the land, and only as the local government specifies (e.g., multistory housing). These land sales make local governments rich and pay for things like awesome subway systems, trains, highways, and stuff that governments pay for.
Local governments borrow from the national government and its banks to pay for a lot of this, too. This makes the national government rich.
Private developers own the buildings (rather, the 70 year exclusive right to use), and sell these to private individuals.
Eminent domain in China is kind of a thing, too, but in practice it’s hard to be forcefully ejected. Supposing the local government wants to redevelop a prime section. It and the developer will negotiate with all of the current homeowners and other legal adults living in each residence, as determined by their household registration (hukou). The hukou isn’t a frivolous thing, so it’s very hard to fraudulent claim you are a resident. Usually the offers are a lot of cash, or cash plus a new apartment (in a different part of town) for each adult resident.
There are ghost sections of my own neighborhood, but luckily some of the homeowners have the sense to recoup some of their investment by renting, lest I be homeless. I live in a villa that rents for about $3000 per month, and it’s on the very low end for the neighborhood. The house is nothing special (after all, “villa” is code for “duplex” or “semi”), but the land it sits on is very precious indeed. My crappy house has one thing billions of Chinese will never have, though: a strip of grass that’s all mine (mine enough, as long as my company continues to pay the rent).
And, yeah, buying an apartment is the number one way that Chinese “invest.” I hope my neighbors don’t decide to eat me if the bubble ever bursts.