I am not an expert on this – perhaps Adam can chime in…
I believe that 2nd mortgage and HELOC are wiped out IF it is the first mortgage holder that is doing the forclosing.
I believe tax liens, mechanics liens, HOA (if they have a lien placed), lis pendens, etc are all things the new owner gets stuck with.
I could be wrong.
I know the rules are a little different in the less common case where it is the 2nd mortgage holder (or HELOC holder) who is forclosing… I don’t think the first lienholder gets wiped out.
On tax liens – I’ve read different things – some suggest they get wiped out in CA, but perhaps not in other states since this is an auction OR judicial forclosure state. If it goes to auction, it’s wiped out. But I’m not absolutely certain on this. My rule of thumb has been to drop properties that have complicated liens from my consideration list. If I see tax liens or mechanics liens, I don’t bother with that property.