There are few industries with as lustrous of a history as banking. With roots tracing back to the American Revolution, U.S. banks have provided the credit that's fueled the nation's ascent from a fledging colony of the British Empire to the independent global hegemon it is today.

This isn't to say the ride was smooth. Since 1790, America has experienced 17 banking panics. That equates to one every 13 years on average. The most minor of these passed with little notice other than to the unlucky folks who lost their hard-earned deposits. Meanwhile, the major panics ignited nationwide economic catastrophes ranging from the Long Depression of the 1870s to the Great Depression of the 1930s to the crisis of 2008-09.

While thousands of lenders didn't weather these storms, many of America's oldest and most esteemed banks not only survived the turmoil but thrived because of it. One of the biggest lenders today was founded by none-other-than Alexander Hamilton, the first treasury secretary of the United States. And more recently, some of the best-performing stocks to emerge over the past few decades are those of regional banks.

What is the bank industry?

The bank industry's core function is to serve as a financial intermediary. Banks take savings from people like you and me and then lend the otherwise idle funds to businesses that need capital or to individuals looking to finance a house, car, or quite frankly anything that can be bought with a credit card. It's for this reason that many economists consider banks and the credit they provide to be the lifeblood of a modern economy.

Beyond this core function, and thanks to a concept known as fractional reserve lending, whereby a bank holds reserves of cash that are less than its customers' deposits, these institutions also play a central role in the creation of money. For example, let's say that Bank ABC overseas $10 million in deposits. If it lends $8 million of that out to local businesses, some of it -- maybe $2 million -- will be deposited back into the bank. By doing so, in turn, Bank ABC is able to turn $10 million in deposits into $12 million.

How big is the bank industry?

Because banks play such a central role in the economy, it should come as no surprise that the industry is massive. According to the Federal Deposit Insurance Corporation, commercial lenders and savings institutions directly control nearly $15 trillion in assets, made up primarily of cash, various types of investment securities, and loans and leases. On top of this, banks collectively oversee more than $20 trillion in assets that are owned by their customers -- these are commonly referred to as "assets under management."

Given these massive dollar figures, it's tempting to conclude that there must be tens of thousands of banks. But while that might have been true at one point in time, it no longer is. Due to failures over the last two decades as well as a deluge of merger activity ignited by the deregulation of branch and interstate banking, the number of lenders has dropped by nearly two-thirds since 1990. At last count, the FDIC's official tally stands at roughly 6,700 commercial banks and savings institutions in the United States.

Of course, not all of these banks are created equal. Some are so large it's difficult to comprehend their size and scope. Others are nothing more than a single branch tucked away in a Midwestern farming community. But while the ranks of the latter markedly outnumber the former, there's no question about where the industry's power resides, as the four largest institutions in the U.S. alone account for almost half the industry's assets.

How does the bank industry work?

The business model of a traditional bank is relatively straightforward. Like any other enterprise, a bank's owners seed it with capital -- on the balance sheet this is referred to as equity. The capital is then leveraged by accepting deposits from customers and arranging for credit lines from other financial institutions. Finally, the combined proceeds are lent to borrowers or used to buy fixed-income securities such as Treasury bonds or, quite commonly, mortgage-backed securities.

The net result is that most banks make most of their money by arbitraging interest rates. That is, they pay depositors a fraction of a percent to borrow money and then lend the very same funds out at 4% or more. The difference between what they pay and receive in interest, in turn, underlies their revenue and thus profit.

Beyond interest income, there are numerous ways lenders and banks can earn so-called noninterest income. They charge monthly fees for checking accounts. They assess overdraft and insufficient fund fees. They collect fees to originate mortgages and auto loans. And, particularly in the case of the nation's largest lenders, they generate revenue by arranging stock and bond sales, facilitating corporate mergers, and providing consulting services that were once the exclusive province of investment banks.

What are the drivers of the bank industry?

The profitability of a typical bank derives from three sources. In the first case, given that most banks generate the lion's share of revenue from arbitraging interest rates, it stands to reason that these rates are the primary driver of bank earnings. The ideal environment is one in which short-term interest rates are low and long-term rates are high. In this situation, the yield curve is said to be steep.

An inherent paradox in the system is that a steep yield curve generally materializes in the immediate aftermath of an economic downturn. And during downturns a second driver of profitability, the credit cycle, weighs on bank earnings as a result of elevated loan losses. That is to say: when the economy is bad, default rates on everything from mortgages to auto loans to credit cards increase. This counteracts the otherwise positive boost from an opportunistic interest rate environment.

The final driver of profitability in the bank industry is the efficiency ratio, which measures how much a bank spends on operating costs relative to its top-line revenue. It cannot be emphasized enough how important this variable is when the typical investor scours the market for a good bank to invest in. Indeed, virtually every bank stock worth owning over the last few decades has been a leader on this front, with an efficiency ratio somewhere between 40% and 60%.

The bottom line on banks

It's impossible to overstate the importance of the bank industry to the growth and prosperity of any country, much less the United States. But this doesn't mean every bank stock is an automatic buy. Like any sector or industry, it's important for investors to be selective about both the specific bank they invest in and their decision about when to do so. Bargains are rare, but they do come up from time to time. The trick is to have the patience to wait.