A lien is a legal claim against a property that secures a debt. It gives the creditor the right to force a sale of the property if the debt goes unpaid — which is why your mortgage is, at its core, a lien on your house.
A mortgage is a voluntary lien: you agreed to it in exchange for the loan. Other liens can land on a property without your signature — unpaid property taxes, an unpaid contractor filing a mechanic's lien, or a court judgment. If payments stop, the lien is what lets a mortgage lender pursue foreclosure.
Liens also come with a pecking order. First position (usually your primary mortgage) gets paid first from any sale proceeds; junior liens like a second mortgage wait in line behind it.
The practical takeaway for buyers: a home can't change hands cleanly until its liens are paid off or released, which is exactly what happens at closing when the seller's mortgage gets retired from the sale proceeds. A title search hunts for undiscovered liens before you buy, and title insurance protects you if one surfaces later.