Shares of Bank of America (NYSE: BAC) trade for a discount to book value because the $2.1 trillion bank earns significantly less than its so-called cost of equity.

Bank of America is the nation's second-biggest bank by assets. It holds more domestic deposits than any other American institution. And, since the financial crisis, it also controls one of the world's preeminent brokerage companies, Merrill Lynch.

But despite these credentials, Bank of America's shares persistently trade for a discount to book value -- and not a minor discount, either. Shares of the North Carolina-based bank are currently valued at 78% of book value. Thus, while Bank of America's assets exceed its liabilities and preferred stock by $228 billion, the market is valuing the company at only $175 billion.

Generally speaking, a bank's shares will trade for a discount to book value if the bank doesn't earn its cost of equity, which compensates investors like you and me for three things.

The first is the risk-free rate of return, typically represented by the interest rate on long-term U.S. government bonds. The second is the stock market's historical rate of return relative to the risk-free rate of return. And the third is idiosyncratic risk, which is the historic volatility, or "beta," of a particular stock.

Here's how this works out for Bank of America: The current risk-free rate of return is 2.25%, the stock market's historical rate of return is in the neighborhood of 8%, and Bank of America's beta is 0.84. Add these together, and you get an 11% cost of equity.

This means that Bank of America must generate a return on equity of at least 11% to fully compensate its investors for the risk, or "cost," of owning its shares. If it earns less than that, which it has since the crisis of 2008-09, then something has to give. And that something is its share price -- or, rather, its share price relative to book value per share.

To better understand this relationship, it's helpful to think about the give and take between the price of a bond and the prevailing yield for similar securities. Let's say you paid $100 for a 10-year government bond that yields 2%, or $2 per year, in interest payments. Six months later, the government issues a new round of 10-year bonds yielding 3%, or $3 a year. If you now want to sell your bond, you'll have to lower the price to $67; it's at this price that $2 in annual interest payments equates to a 3% yield.

When it comes to bank stocks, in turn, the give and take is between a bank's return on equity and the value of its shares. If a bank's return on equity is lower than its cost of equity, then its shares will generally trade for less than book value. If bank's return on equity exceeds its cost of equity, then its shares will generally trade for more than book value.

It's this relationship, in turn, that explains why Bank of America's shares trade for such a large discount to what they otherwise seem to be worth. Over the past 12 months, the bank has earned a mere 3.8% on its equity. That's 7 percentage points below its 11% cost of equity. It accordingly stands to reason that investors are demanding a 22% discount to book value in order to offset the deficiency.