What you describe is essentially rent control. From what I understand (and I am far from an expert), most of these people have lived in SF/LA for a long time, surviving due to rent control. But it's greatly in the landlord's interest to get them to move out, and eventually it happens, and then they are stuck.