Most of it, if not all, will go towards the foreclosure process. The cost of foreclosures are quite expensive, and show exactly why a bank or lender does not want to own your home. They would rather work out a loan modification or work out a payment plan for you to keep the house.
Fees include:
If you cannot afford making your payments, typically banks will work with you and be accomodating if you tell them what is happening to your finances. They do not want to foreclose.