Foreclosure is a legal process that occurs when a homeowner fails to make mortgage payments, resulting in the lender taking ownership of the property. This process allows the lender to recover the amount owed on the defaulted loan by selling or repossessing the property.