Editor's Note: The article has been adjusted to correct the Texas Ratio of Flagstar Bancorp. The Motley Fool regrets the error.

Recently, fellow Fool John Maxfield posted an incredible chart of bank failures going back over 100 years. The lesson is as scary as it is clear: banks fail all the time. Eighteen banks failed in 2014. Two more have already bitten the dust so far in 2015. 

When banks fail, shareholders are the biggest losers. Deposits are insured by the FDIC. Loans and other assets are auctioned off to other institutions. Even management will typically find a new job at a different bank (and almost never wind up in trouble with the law). 

Shareholders, though, are wiped out. The best-case scenario is that another, stronger institution will buy the bank before it fails; at least then investors get some value for their stock.

That's why it is so critical to invest in healthy banks with strong fundamentals and tight risk controls. In other words, banks that are nothing like the three listed below.

But first, a couple of tools to evaluate the likelihood of a bank failure
Bank failures are not totally different from bankruptcies in other industries. Banks can become over-leveraged causing a capital shortfall. They could run out of liquid assets and become insolvent. A lack of profits over time could also deteriorate the financials of the institution to the point of failure. But all of those results are symptoms. We need to get to the core.

The key to a bank surviving over the long term is primarily driven by the quality of the loans the bank makes. If loans are repaid, the bank will most likely do fine. If loans become deliquent and loan losses mount, the likelihood of a failure skyrockets. 

That's why a good place to start is by looking at a bank's problem loans relative to its total loans or total assets. In bank speak, these loans are called nonperforming assets.

And a specialty ratio called the "Texas ratio" is a fantastic tool to gauge the likelihood of a bank failing. It is calculated by dividing all the bank's nonperforming assets, which are severely delinquent loans plus foreclosures, by its tangible equity and loan loss reserves. A bank with a Texas ratio above 100 is considered at high risk of failure.

Now, on to the banks.

1. Flagstar Bancorp
Troy, Mich.-based Flagstar Bancorp (NYSE:FBC) is a $10 billion institution with a host of severe problems that should make investors shudder.

The bank reported a net loss just shy of $70 million for 2014, driven primarily by problem loans and an inefficient operation. The bank's CEO, Alessandro DiNello, summarized the struggle succinctly in the fourth-quarter earnings press release: "We have been working tirelessly for the last two years to de-risk the balance sheet, settle major legal matters, right size operating expenses, upgrade our management talent, build a strong risk management organization and focus our business strategies."

DiNello has done an admirable job attempting to turn the bank around since being hired in mid-2013. That said, the bank has far to go before it's out of the woods. According to regulatory data compiled by BankRegData.com, the bank's latest Texas ratio was 87 (though it's only 49 once you exclude loans guaranteed by the government). On top of this, it reported non-performing assets equating to 4.82% of total assets. While this is much better than it was two years ago, it's still 4.2 times higher than a national average of the bank's peers.

2. Doral Financial
Puerto Rican banks have had a particularly tough time since the financial crisis, and none epitomizes that more than Doral Financial (OTC:DRLC). Confronted with a stagnant economy, shrinking population, and allegations of fraud, Doral's stock has declined by nearly 98% over the past five years.

The bank reports total assets just shy of $8.5 billion, and its balance sheet is characterized by the sizable portfolio of past-due real estate loans. The bank's Texas ratio was 140 as of Dec. 31.

Doral has survived on the edge of the precipice for some time now, and it's entirely possible that it will continue to do so. The bank's Texas ratio has been above 100 since 2009, peaking at 159 in the third quarter of 2011.

The bank's struggles go well beyond the financial. In 2010, Doral's then-treasurer was sentenced to five years in prison for fraud after misguiding investors on the value of the bank's mortgage-backed securities. The next year, the bank's executive vice president for mortgage and bank operations was murdered while driving in the Puerto Rican capital, San Juan. The homicide remains unsolved, but investigations have thus far centered on a conspiracy to prevent the executive from going public with further evidence of fraud. 

3. Hudson City Bancorp
Of the banks presented here, Hudson City Bancorp (UNKNOWN:HCBK.DL) is the most likely to cease to exist in 2015, but even that is not a certainty. And that is in spite of the bank's healthy Texas ratio, which was 22 as of Dec. 31.

Since 2012, the struggling bank has operated under an agreement to be acquired by M&T Bank (NYSE:MTB). That deal has stalled due to an exceptionally slow approval process from regulators. Management at both Hudson City and M&T remain committed to the merger, and approval seems likely in the next year.

However, if that approval does not come and Hudson City remains independent, it has severe problems that could force an acquisition by another bank. Or, worse yet, they could cause the bank to fail. 

Using data from the bank's regulatory filings compiled by BankRegData.com, the bank's ratio of nonperforming assets to total loans stood at 2.43% as of Dec. 31. That is over three times the bank's peer average. Loans in nonaccrual status -- those greater than 90 days past due or with other severe problems as identified by management -- represented 3.73% of total loans, about six times the peer average.

With that level of problem loans on the balance sheet, even a slight deterioration could drive the bank out of business. Fortunately, though, Hudson City has maintained profitability and a relatively high capital level, giving it some cushion in that worst-case event.

There is no crystal ball
Just because these banks face tremendous challenges does not guarantee they will fail this year. Those challenges just mean they are at a much higher risk of failing or being acquired by a stronger institution. However improbable, it is not impossible that these banks could right the ship and navigate a turnaround.

I suppose one can always dream, but the chances of that turnaround story are quite slim. These banks instead are cautionary tales and examples of the kind of institutions bank investors would do well to avoid.