It's called fractional reserve banking. Banks assume that their depositors won't all want their money out at the same time, so don't keep enough cash in their vaults to pay them all. Most times that is just fine, but if savers think that the bank is in trouble, and they do all come in at once to close their accounts – Northern Rock style – it causes problems.
If you can be pretty confident that there won't be a run on the bank, then it makes sense for banks to lend out the money, where it can create businesses and jobs, rather than keep it locked impotently in their vaults. But a surprising number of people have put the case to me recently that this policy, though rational, is in fact another name for trading while insolvent.
Of course, if the banks can call in their loans as quickly as savers could demand their money back, there would be no problem (except to the borrowers - who would know from their lending agreement that the bank could foreclose on them suddenly, and who would therefore have to be prepared for it). Ideally, a bank should match the length of its loans to the notice period on its savings accounts, so that it can pay its 90-day depositors by calling in 90-day loans. But many banks give mortgages of twenty years and more, while their depositors don't want to be locked in for anything like that time. So the banks just have to pray that savers don't all want their cash at once.
Right now, the government is pulling the banks in different directions. They've lent too much, came a cropper, and now they are trying to build up their reserves. So they're keeping loans hard to get. But the government wants us all to borrow and spend more so that we stave off recession, and are pressuring the banks to lend a lot more. Well, that's what got us into this mess in the first place. Despite everything, I think that bankers are probably better at running banks than are politicians.