If you fall behind on your mortgage payments, and the lender has accelerated the loan and begun foreclosure proceedings, a Chapter 13 bankruptcy is often the only realistic way to save your home from foreclosure.
Unless you can come up with all the unpaid mortgage payments, late fees, legal fees, and other costs right away, your lender will often proceed with foreclosure while offering loan modification options under HAMP and other programs, which may or may not halt the foreclosure. People often rely exclusively on the loan modification programs until it is too late and they are on the eve of a foreclosure sale.
A key point to keep in mind is that until the lender agrees to stop the foreclosure by entering into a loan modification, the law firm handling the foreclosure will be proceeding full speed ahead. This confuses many people. The bottom line is that it is good to know about Chapter 13 bankruptcy, which can be a clear solution for some people, even if you want to give the loan modification a chance.
Chapter 13 bankruptcy is the only way to immediately stop the foreclosure process and force a lender take payments of arrears over time (3-5 years).
Besides saving your home, Chapter 13 often provides the substantial added
benefit of discharging unsecured debt (like credit cards), resolving tax problems, and reducing the amounts owed on debts like car loans.
You can get more detail here: Chapter 13 bankruptcy.