There are two kinds of homestead protection in California. The first doesn't require any action on the part of the homeowner; it's automatic. The other requires the filing (recording) of a declaration of homestead by the property owner. The protections afforded by each are somewhat different, but significantly overlapping, so that recording a declared homestead may be a good idea for some but failure to declare doesn't leave one totally unprotected. The usual exemption is $50,000 of equity, and it can be higher for older folks and other special groups.
Declared homesteads are effective ONLY against liens and claims that are recorded AFTER the homestead. Further, both kinds of homestead are ineffective against voluntarily-created liens such as mortgages and deeds of trust. Therefore, a homestead is absolutely, 100% useless against a lender whose deed of trust is already on record. The most common motivation to record a declaration of homestead is when you are being sued and you are afraid that a judgment might be recorded against you in the future.
Further, a homestead does not prevent foreclosure; at best, it only re-allocates some of the proceeds of the foreclosure sale if the foreclosure is, for example, the holder of an involuntary lien like a judgment. Again, no help at all on a mortgage.
So, the answer to your last two questions are 1. A homestead protects you from involuntary liens liks judgments, and 2. In your friend's case, no.