Debt consolidation in itself is simply the process of combining multiple debts into a single one, presumably at a lower interest rate. There's quite a few ways to go about it, but they all generally involve borrowing money from someone at a good interest rate to pay off debts from other people charging not-so-good interest rates.
As an example; lets say you had three credit cards all charging 20% interest on your respective balances of $5000 on each card. Your bank offers you a cash loan of $15,000 at a 10% interest rate. You borrow the money from the bank and pay off your credit cards, and start making monthly payments on the bank loan at 10% interest instead of 20% on the credit cards. In doing so you reduce your interest charges by half, and have two less bills to deal with each month. That's debt consolidation.
Because the bank makes it's normal profits from interest on your cash loan; they're doing business as usual, you're saving money, and it's just the credit card companies that lose out on the extra charges (but we won't have a lot of sympathy for them at the rates they charge, and you're certainly allowed to pay off your balances at any time).
Debt consolidation specific companies and organizations do the same thing as the bank would in the above scenario, but they do a little extra leg work by paying the bills on your behalf on top of providing you with a new loan at a better interest rate.
In both cases the motivation is still profit for the new lender/company, just less than the original debtors were making with their higher interest rates. Customers who have security to place against the new loan (like a house) will normally get the best interest rates when consolidating, and as such will save the most money.