Suppose you were the benevolent government of a wealthy first-world nation, and you wanted your poorer citizens to have better access to mortgages so they would be more likely to own homes. A natural way to do this would be to create a government agency (or two) for the purpose. Since you would be sensible enough to use market interest rates, you would let these agencies run like corporations, but you would provide them with capital and with a mandate.
Actually, rather than provide them with your own capital, you could just let it be known that you will provide security for their debts. Then they could borrow the capital from willing investors. There, that wasn't hard, was it?
Now the agencies begin to grow, which of course they must in order to perform their mandated task. And as they grow, they discover something interesting. Doing something no one else is doing is hard; but doing exactly the same as every other lender is very easy indeed. Not only easy, but -- thanks to the funding advantage you have given them -- highly profitable!
What funding advantage? Well, a national government's cost of borrowing is lower -- typically by 20-30 basis points -- than even the highest-rated bank's. Since those willing investors are so reassured by your promises of repayment, they will lend the agencies money more cheaply than they will to banks. So the agencies can compete directly with the banks, not innovating but doing exactly the average mix of business, and by doing so they can be more profitable than the banks can. How happy their executives must be!
But there's more: just by growing bigger and doing the same thing on a larger scale, your agencies can make still more profit. In fact, they can keep doing this as long as they are reasonably small compared to all the private sector banks put together. Congratulations -- you have now created big scary monsters. [Unless you have the misfortune to be Germany, whose banking sector looks like the final scenes of Pitch Black as the surviving nonstate banks blast off for foreign space.]
If you want to understand this in detail, try the Affordable Housing Institute blog [HT: Mickey Kaus], which details with links how the Big Scary Monsters have neglected their mandate and taken gigantic risks at taxpayer expense.