A few months ago, I would have called this one a no-brainer -- Bank of America (BAC -0.53%) was, hands-down, the better value of the two for most of the past several years with a rock-bottom valuation and improving business fundamentals. However, Bank of America was one of the best performing bank stocks of 2016, up 31%, while Wells Fargo (WFC -6.02%) lagged the market and financial sector, and rose just 1% for the year. So, now is a good time to take another look.

Which bank could best help your portfolio grow in 2017 and beyond? Image Source: Getty Images.

Why did banks, and Bank of America in particular, perform so well in 2016?

In a nutshell, banks did so well in 2016 because Donald Trump was elected president in November, and people expect a lot of deregulation to occur in the banking sector -- which will in theory drive up profitability. To be fair, by that point most bank stocks (with the notable exception of Wells Fargo, as I'll discuss shortly) had already rebounded nicely since their February lows. However, as you can clearly see in the chart below, the vast majority of the gains took place during the last two months or so of the year.

BAC Chart

BAC data by YCharts

The primary reason for the increases both before and after the election are interest rates, specifically the speculation that interest rates are going higher. Because of the record-low interest rates of the past few years, most banks have operated at historically poor profit margins.

Bank of America did particularly well because it stands to benefit more than most if interest rates pick up. Its return on equity (ROE) and return on assets (ROA) haven't been great in recent years, and the bank recently quantified the impact higher interest rates could have. In its latest quarterly filings, Bank of America said that a 100-basis-point (1%) increase in interest rates would produce an additional $5.3 billion in net interest income annually, significantly higher than projections from JPMorgan Chase ($2.8 billion) and Citigroup ($2.0 billion).

As my colleague John Maxfield pointed out, Bank of America has the most noninterest-bearing deposits of the "big four" banks, which means that, as interest rates rise, the bank generates more income, but doesn't have to pay out any more on these deposits.

This newfound reason for optimism, combined with the fact that Bank of America was trading for a substantial discount to book value for most of the year, is the main reason shares spiked as much as they did. In addition, Trump has pledged to reduce regulations on banks, which could save money on compliance costs and generally make it easier for the banks to do business.

Wells Fargo's scandal -- the 30-second version

By now, I'm sure you've heard about Wells Fargo's "fake accounts" scandal, which was the main reason for the bank's underperformance. Essentially, thousands of the bank's employees created millions of unauthorized banking and credit card accounts in an effort to make sales goals. Over the next several months, the scandal did indeed translate into fewer new accounts being opened and lower confidence in the bank, which further spooked investors.

To be clear, Wells Fargo's profit margins will benefit from rising interest rates as well. It may be to a lesser extent than Bank of America, but if you read the article I linked in the last section, you'll see that almost the same percentage of Wells Fargo's total deposits are noninterest-bearing as Bank of America's.

Profitability and valuation

I briefly mentioned that Bank of America's profitability metrics have been less-than-stellar recently. Well, that hasn't been the case for Wells Fargo, which has consistently been the most profitable of the big U.S. banks for years.

BAC Return on Equity (TTM) Chart

BAC Return on Equity (TTM) data by YCharts

As a result, Wells Fargo has traded for a significant premium to most peers, especially Bank of America. In April 2016, for example, Wells Fargo was trading at a valuation of 1.42 times its book value while Bank of America traded for a P/B multiple of 0.58. In other words, Bank of America was trading for 42% less  than the value of its assets.

Fast-forward to the present day, and while both banks' valuations have increased thanks to the "Trump rally", the gap has narrowed considerably. Wells Fargo now trades for 1.54 times book, while Bank of America's discount is nearly gone, with a P/B of 0.93. Simply put, Wells Fargo's valuation is slightly above where it had been for much of 2016, while Bank of America's has soared.

The verdict

In a nutshell, Wells Fargo is an efficient and profitable bank, whose stock barely rose in 2016 (and rightfully so) because of its fake-accounts scandal. While it's unclear what long-term effects the scandal may have, I don't see any reason that the bank's excellent history of profitability will be in jeopardy anytime soon, and it could benefit tremendously under the Trump administration just like Bank of America.

On the other hand, Bank of America is less of a sure thing. If you buy Bank of America, you're buying it for what its profitability could be. The bank's profitability metrics have been lackluster for some time now, and while there's potential for profits to soar in the coming years, a lot of things need to happen first (higher interest rates, lower banking regulations, etc.) for the bank to reach a consistently acceptable return on assets.

To sum it up, a bet on Bank of America's future profitability, while still appealing, was much more attractive when the bank was trading for a huge discount to its book value, as it was for most of 2016. In fact, I bought so much Bank of America stock in the first few months of 2016 that the recent gains have made it my single largest stock holding. At the current valuation, however, Wells Fargo simply makes more sense for new investors, and it's on my watch list as we head into 2017. The only thing I'd like to see before I dive in to buy Wells Fargo is a little more clarity on Trump's plans in regards to taxes and regulatory changes, which we'll likely get once he takes office.