The goal for most individuals in bankruptcy is to receive a discharge of their debts. A discharge is a release of your legal obligation to repay your debt. With limited exception the discharge will discharge all your debt including credit card bills, medical bills, auto loans, home mortgages, and some tax obligations.
Some debts do not typically get discharged in bankruptcy including student loans, some tax obligations, child support, alimony and government or court fines (such as a speeding tickets).
The discharge does not typically affect a lien held on property. Therefore in order to for the debtor to keep property that has been used as collateral to secure a loan, the debtor must continue to make payments.
Some liens can be removed in bankruptcy. Liens held by the second mortgage can be removed, in this case the debtor will be able to keep their home and never again have to pay the second mortgage.
Judicial liens can also be removed. These are liens that have come out of a court action. Typically these occur after a credit card company has sued you over a debt and then they put a lien on your home.