The very best banks -- large or small -- will be prudent, profitable, and efficient. That's a given, and it's no secret.

The secret to investing in small-bank stocks is pretty obvious, as well, but deceptively so. It's almost too obvious. It's all about investing in the best banks located in best local and state economies.

The secret revealed
Banks do business by accepting deposits from individuals and businesses, and then reinvesting those funds in the form of loans. The whole process happens within the geographical footprint where the bank operates its branches.

There is obviously more than a single factor at play, but the small banks with the best odds of going from average to high performing will be the ones that operate in the areas with the strongest underlying economic growth. It's so obvious, it hurts.

The logic makes perfect sense. A region with strong economic growth will have more jobs with better salaries. The businesses there will have higher revenues, more growth opportunities, and more consistent cash flow.

That translates to individuals with more deposits and savings, more demand for home and other loans, and more need for other financial products, like wealth management or insurance. The businesses will have a greater need for cash management, capital to expand facilities, pay for working capital, and hire more workers. That, too, means more loans and more fees for local financial institutions.

Larger banks have such expansive footprints that the fate of a single, local economy isn't likely to move the needle. Small banks, though, will feel those effects. In today's environment, most small banks have footprints that vary from a few towns, to a region of a state, to perhaps a whole state or two.

As investors, that means our best chance of finding a high-flying small-bank stock is to focus on the hottest state economies.

There's research to backup the logic
In a study by the Federal Reserve, researchers found that the performance of state economies had a strong correlation with the performance of community banks in the region. The team used bank returns on assets, non-performing loan rates, foreclosures, and net loan losses, and found relationships with a state's unemployment rate, employment growth rate, per capita income growth, and personal income growth.

The correlations were quite strong: The team found that, for example, a single-percentage-point increase in a state's unemployment rate increased the non-performing loan ratio by 17 basis points.

A real-world example
The logic makes sense, and the research supports it. With those factors in your favor, it's not difficult to find a few anecdotal examples. Consider Texas during the past few years.

Thanks to the oil and gas industry, Texas was able to battle through the recession with much more success that the rest of the nation. It wasn't a walk in the park, but the state really did hold its own quite admirably.

Texas Change in GDP Chart

Texas Change in GDP data by YCharts.

And as we would predict, Texas community banks also did well during the same period of time. They outpaced the KBW Bank Index, a common bank stock benchmark, by a wide margin. The KBW Bank Index is tracks the performance of 24 major banks from across the U.S.

^BKX Chart

^BKX data by YCharts.

More recently, the price of crude oil has collapsed, dropping over 57% in the last 12 months, ending the Lone Star state's streak of strong economic performance. As we would expect, that has translated to a sharp drop in these community bank prices, driven by higher loan-loss reserves, loans linked to the oil and gas industry, and the overall decline in economic fundamentals.

During the past year, those same bank stocks have fallen faster and farther than both the KBW Bank Index and the S&P 500.

KBWB Chart

KBWB data by YCharts

Focus on state economies, then find the best banks in that area
For local and small-regional institutions, the lack of geographic diversity makes the local economy a paramount concern for long-term investing. The secret to investing in small banks, therefore, is to buy stock in the best banks in an area with strong underlying economics. A rising tide will lift all boats.

Choose the banks in those economies that are conservative in their underwriting, and have excellent cost management. They'll ride the rising tide higher than the competition, and give truly elite performance.