Let's say a home is financed for $300,000 and the fair market value has dropped to $200,000. If the lender does not agree to work with the borrower and they walk away from the home they instantly lose $100k based on the market. Now let's not forget the monthly interest payments not being made, cost of selling the home, cost of fixing up the home (most foreclosures are trashed from previously angry homeowners ....understandably so.) After everything is said and done the bank can probably estimate a loss of $150-200k.
Now if the bank agrees with a modification:
Let's say the current loan is at 6.5%. Since it is very unlikely that the bank will still hold the note throughout the entire life of the loan let's use 5 years as an example. $300k at 6.5% over 5 years equals $52k profit. If the bank drops the interest rate to 4.5% they will still make a profit of $36k in interest.
Still making any sort of profit is much better than losing around $150,000-$200,000. It's win win. Borrower's get a lower payment and most importantly get to stay in their homes. The bank takes a small step towards stability by maintaining profitability.