For instance, suppose they build 100 apartments in the suburb of X. They know that for every $1k the price of housing in X drops, they lose $100k. So weirdly, they tend to leave housing vacant and sell it at a drip-feed so that they're always selling less houses than there are buyers - there is a huge difference between selling 3 apartments to 4 buyers, vs selling 4 apartments to 4 buyers. This particularly bad when there are few, large developers instead of lots of small developers, as the few large developers can collude to price-fix much easier.
Please don't interpret this as contradicting the fact that California needs to massively overhaul its zoning/construction permit system - the fact that it can take years to receive permission instead of weeks is a big reason for the price of housing (and raises capex requirements which results in fewer but larger developers, see previous paragraph). Ditto for all the zoning that mandates exclusively single-family homes, and other such pointless exclusionism.
But painting NIMBYism in such reductionist (and long-term economic-investment backward) as "development would make real estate investors and developers lose money" would just result in people fighting entirely the wrong battles with entirely the wrong message to actually have a chance at changing things in a useful way.
Seattle and NYC are both examples of places that funnel all development into a select few areas where the market for land is cornered.