For a variety of answers, see an empirical study by Alan White and Carolina Reid called Saving Homes? Bankruptcies and Loan Modifications in the Foreclosure Crisis. Here is the abstract:
Do homeowner bankruptcy filings work to delay or prevent home foreclosures, and how do they compare to voluntary loan modifications specifically targeted to mortgage relief? The 2007–2012 financial crisis provides a unique opportunity to assess whether bankruptcy can help homeowners avoid the negative consequences of over-indebtedness and mortgage default. This empirical study analyzes a large, loan-level mortgage dataset to determine which variables are associated with delinquency and bankruptcy filing, and in turn, whether filing bankruptcy or receiving a loan modification measurably influences subsequent loan outcomes (e.g., foreclosure sale, prepayment, or default cure). Overall, we find that bankruptcy filings delay foreclosures but are not generally effective in curing payment defaults, especially when compared to modifications negotiated outside of bankruptcy, which are highly effective. We also find, consistent with prior research, that variations in state bankruptcy and foreclosure law greatly influence debtor outcomes from one state to another. Bankruptcy filing is more effective in states with nonjudicial foreclosure and limited homeowner protections.