Different state has different laws.
Like in Florida, Senior lien foreclosure will wipe out junier liens. But enve so you may still liable for certain junier lien payment. For example, in Florida, the HOA lien will be wiped out by first mortgage foreclosure but the new owner will still be liable for the amount owed to the HOA. If you do not pay, The HOA can put a new lien in or prevent you from re-sale it.
The foreclosure party only informs all parties that have interests in this house, telling them that a foreclosure is happening. they do not resolve anything. You never get a clean title by this way.