Did she even bother to draft a contract with the subletter? Or was this all just, "sure, stranger, move right on in to the property for which I am legally obligated? I'm sure this will all work out fine."
A legal contract is only as strong as the incentives to litigate it. Doesn't seem likely a contract would've helped, it may even have existed.
Yes, landlord reasonably checked out. They agreed on terms in terms of the monthly amount, utilities etc. New roommate gave some reason to want to get going on getting their stuff moved in or measuring things or something, she gave them a copy of the key for that.
That's all it took.
Regardless, tough lesson to learn on not handing out a key to someone without a contract. I mean, that's a level of trust that I don't even have with my friends, much less someone I'm potentially going to room with. No contract, no keys.
I had a feeling there was more to the story. There probably still is, but I'm satisfied now on how this managed to "just happen". I still don't understand how, after the restraining order, this person then claimed legal residence in order to get your friend removed from her legal residence. I also don't understand why this wasn't immediately a phone call to the police to get this person removed from the property.
My (female) friend HAD TO MOVE OUT of the house she was renting, the landlord required she still pay rent on the lease. "self-help" (changing locks) was totally out.
All this would have been fine I think if she could have gone to court in a week or two (the person literally hadn't paid anyone anything).
Instead it was 18 months to the FIRST court date, plenty of drama between A and B, and at that court date it was clear it was going to take a LONG time longer (in fairness COVID came into picture but still).
It turned out of course this person had done this repeatedly. In my friends case the landlord just demanded she keep on paying rent and so was no help on eviction. So she was paying rent on a new place, paying rent on the old place AND paying legal bills vs a tenant getting free community legal help and who was an absolute expert in the rules.
Luckily for her for some reason tenant DID want to move eventually, and they basically arranged a settlement. She paid landlord for some damages, she paid tenant a cash for keys amount (substantial) and was allowed to go on with her life.
You could only afford this on a bay area tech level salary. For normal landlords and people this is insane.
When someone says the eviction has to be "for" a reason, and a court has to review that reason and approve it, in the bay area that easily 1-2 years if someone wants to stretch it out.