What do banks do? Two things. First, they maintain their customers' deposits, paying interest on them for the privilege. Second, they lend some of their customers' funds to creditworthy borrowers, charging them interest for the privilege. Banks make money, in brief, by taking a bit off of the top when transferring interest payments from their debtors to their depositors.
What is the economic value of what banks do? Banks perform the important tasks of liquidity & maturity transformation. In so doing, they play the role of financial intermediaries--institutions that match savers with borrowers, facilitating investment. Investment, in turn, is a critical driver of economic growth.
A depositor, in general, wants to invest in a short-term, highly liquid vehicle. That is, she wants to be able to, on a moment's notice (short maturity), convert her investment into cash (high liquidity). A bank deposit offers her just that. As long as her savings reside in the bank they yield her interest. Whenever she wishes, however, she may make a withdrawal, converting her investment into cash without warning.
A borrower, in general, wants to provide a long-term, illiquid vehicle. That is, he wants to be able to spend his borrowed funds over a long period of time (long maturity), without necessarily being able to convert his purchases into cash in the interim (illiquidity). For example, if he borrows from the bank to buy a house, he may not be able to fully pay off his mortgage until it matures (say, thirty years from now), because his stream of income prevents this. A bank loan offer him exactly what he wants. As long as he makes his payments on time, he need not fully pay for his purchases until his loan matures, which may be well into the future.
How do banks manage to match depositors with borrowers, then, given their divergent wants? They manage to do this thanks to the law of large numbers. The withdrawal behavior of each depositor is very unpredictable. Because the behavior of one depositor is independent of the behavior of others, however, the law of large numbers entails that the withdrawal behavior of many depositors is very predictable. A bank that enjoys a large number of customers may confidently predict aggregate withdrawals on a given day, even if it cannot predict how much each customer withdraws. As a consequence, banks keep just enough cash in their vaults (their reserves) to honor these predictable withdrawals, freeing up the remaining funds to be invested with long-term, illiquid borrowers. Banks, therefore, make possible productive investments that would otherwise not be possible, thereby contributing to economic growth.
Sounds too good to be true, doesn't it? There is, indeed a catch: Exploiting the law of large numbers is only possible because, most of the time, the behavior of one depositor is independent of the behavior of others. If withdrawals become correlated, the business model of banking breaks down. Suppose, for illustration, that a bank invests heavily in one sector of the economy (e.g., housing), believing that this promises the highest risk-adjusted returns for its depositors. Suppose further that many of these investments go belly up, with large numbers of borrowers defaulting on their loans. A depositor, observing this, worries about the ability of her bank to make good on her future withdrawals. Moreover, she knows that if she is worried about this, other depositors must be similarly worried. Even if the bank is in fact solvent, it is never in a position to make good on every deposit simultaneously, for some of the funds have been invested. Knowing that others will make larger-than-usual withdrawals, fearing that the bank is insolvent, it is in her best interest to beat them to it. If she isn't one of the first to get her money out of the bank, the bank may not be able to honor her deposits, even if it was solvent in the first place.
A banking panic (or bank run) is a self-fulfilling prophecy. Fears concerning a bank's solvency trigger correlated withdrawals, rendering the bank insolvent regardless of its prior condition. Systemic banking panics occur for similar reasons. If many banks turn out to have exposure to lots of bad loans, uninformed depositors may play it safe, running on their bank regardless of its individual exposure. This pushes the entire banking system into insolvency, causing a complete breakdown of financial intermediation in the economy, severely undermining economic growth.
Most economists, therefore, believe it is part of the role of government to stem banking panics, but not to make every failing financial institution whole. It is also important to regulate banking, because if banks can count on the government to bail them out in a panic, that limits their downside, encouraging them to take excessive risks with their depositors' funds. The best way to do these things, however, is a matter of considerable debate. With the introduction of deposit insurance, depositors no longer monitor commercial bank's investments, which is why the government tightly regulates them (for better or for worse). In the recent financial crisis, there were runs on so-called 'shadow banks', which work similarly to commercial banks, but operate outside of ordinary bank regulations.
The most important lessons, going forward: (1) preserve the banking system, not individual banks; (2) preserve institutions--preserve neither the management, nor the shareholders; (3) the purpose of regulation is to force bankers to put their own money on the line, not just the taxpayer's--otherwise, keep it simple. The US definitely erred too much on the side of caution in '08-'09, for which it may be rightly criticized, but it is safe to say swinging too far in the other direction may have done even more damage to the economy. Pick your poison.