Foreclosure is the legal process by which the mortgage holder attempts to recover the balance of a loan from a borrower who has defaulted by forcing the sale of the asset used as the collateral for the loan. Generally speaking, once the mortgaged property is sold, any proceeds received are first paid to the senior lender to satisfy the mortgage. The lender is typically also legally entitled to recover any unpaid interest as well as legal fees and other costs incurred during the foreclosure process. Once the senior lender is fully repaid, any remaining proceeds are paid to junior creditors, and if any funds still remain, they are distributed to the mortgagor/borrower. If the mortgage carries recourse to the borrower, then the senior lender may be able to seek a deficiency judgment from the borrower in order to collect any shortfall between the sales price and amounts owed to the lender.