With July now behind us, most of the major banks in the United States have reported second-quarter earnings. It was a mixed bag, as some banks outperformed and beat earnings estimates, while others underperformed and missed them.

But let's take a look at some of the trends that emerged from the second-quarter results and see what that tells us about the industry. Is now the time to buy bank stocks?

Interest income is up

Banks make a significant portion of their revenue on the interest gained on loans, so the higher the interest rates, the more interest income a bank generates in net interest income (NII) -- assuming loan activity doesn't fall off a cliff. A good indicator to know is net interest margin (NIM), which measures how much a bank gets in interest on loans compared to how much it pays out in interest on deposits. When the NIM is higher, the bank is making a higher percentage of interest than it is paying out.

In the second quarter, among the top 100 U.S. banks, NII was up about 17% year over year and 9% from the previous quarter, buoyed by the Fed Reserve aggressively raising interest rates to combat inflation. NIM was, on average, at 2.53% -- up from 2.2% a year ago and 2.32% the previous quarter. That 2.53% is the highest since the second quarter of 2020, according to Bank Reg Data.

These are good trends for banks, and with the Federal Reserve Board signaling that it will continue to raise rates until inflation comes down (and perhaps longer), investors should expect banks to generate high levels of net interest income into next year, and perhaps beyond.

Impact of a recession

While the net interest income trend is positive, the other side of the coin is loan activity. If the amount of loans a bank makes slows down because rates are too high or the economy is weak or in recession, it would negatively impact a bank's revenue -- if less money is loaned, less interest is earned.

Simply put, banks are cyclical stocks that perform well when the economy is strong because businesses and consumers are borrowing and spending, and less well when the economy is in recession because people and businesses are not borrowing and spending as much.

We're in an economy right now that has shrunk for two consecutive quarters, as the gross domestic product (GDP) declined 1.6% in the first quarter and 0.9% in the second quarter. Some economists already believe the U.S. is in a recession, although it isn't officially one until the National Bureau of Economic Research's Business Cycle Dating Committee says it is. Part of the delay in making the determination is that the current economic situation is not like past recessions in that consumer spending remains solid and the 3.5% unemployment rate is well below historical averages and the lowest since before the pandemic -- with wages going up.

As far as banks go, loan activity has not slowed down -- in fact, most of the major banks saw loan balance increases in the most recent quarter for businesses and consumers. What has impacted banks the most, primarily the large megabanks, is a slowdown in investment banking due to a drop in M&A activity, as well as declines in their asset management businesses due to declines in the overall stock market.

Is this the time to buy bank stocks?

The big question is the economy. Economists are split on their forecasts of whether or not the economy has or will fall into a recession, with many saying the likelihood is below 50%. The indicator to watch is inflation, and whether the Fed's aggressive interest rate increases have the effect of reducing inflation and slowing down the economy.

But generally speaking, this is a good time to invest in banks, as they have shown their ability to navigate the last two quarters of downturn, given the strengths in the job market and consumer spending.

Also, their stock prices have already come down significantly during this bear market, so their valuations are much lower, as determined by key metrics like the price-to-earnings (P/E) and price-to-book (P/B) ratios. At the same time, the rising interest rate environment should provide a major tailwind for banks in terms of generating more revenue and net interest income. 

Of course, all banks are not the same, so be sure to do your research to determine which are the best banks to buy right now.