More than one creditor might have a claim to a security interest in collateral, especially valuable collateral. The most common example is a second mortgage or a home equity line of credit, when the homeowner has pledged the house as collateral, despite the fact a first mortgage exists. Just as the idea with one-lien collateral is that sale of the collateral provides an alternative source of payment for a loan, when there are multiple liens the idea is the sale of the collateral could in theory pay all of the loans. How does the law decide which creditor has greater rights? The law of secured transactions handles this with the concept of priority.
It is possible to have more than one mortgage debt associated with a particular property. In that event, one mortgage lender has first-dibs on the property via foreclosure, typically due to it being an earlier lender. Such lender is termed more senior than the other more junior mortgage lender(s). If the first mortgage holder forecloses, the foreclosure wipes out the junior mortgages along with the debtor's interest in the property.