Residents can do nothing and just let that keep happening, but if they do, they'll eventually end up getting priced out.
It's true that this could be fixed at the city level by streamlining the process. My supervisor, Scott Weiner, is pushing that, specifically for 100% affordable housing. That's not going anywhere, which demonstrates that the opposition to development is more about wanting parking, light, and views - not about affordability.
Now there are several causes for this. A major one is concentrated harm vs distributed benefits for specific development. A new development in a residential neighborhood is gonna piss off a small number of people and motivate them to organize to put pressure on the planning commission. This development would benefit pretty much everyone else, but in a way that is so distributed that it's really hard to motivate people to fight for it. A new development is gonna have a very concentrated impact on neighbors and a very diluted effect on the rest of the city.