recently announced that stock buybacks are all the rage. This year, companies have announced buyback plans totaling $150 billion, up from only $20 billion last year. Of course, companies can buy back shares for several reasons. As I've written before, most CEOs are lousy investors, so we need to evaluate each buyback independently.

Buybacks: The Good
Buybacks are good when the company has excess capital and the price of its stock is trading below intrinsic value. AutoZone (NYSE: AZO) is an excellent example of what good buybacks can do for a company. From 2005 to 2009, AutoZone bought back almost $4 billion worth of stock. Furthermore, it has been a consistent purchaser of stock. In other words, it keeps buying back stock, even when the market is tanking. Shareholders have been rewarded -- diluted earnings per share increased from $6.55 to $11.73 over those same five years.

A recent example of a good buyback is Legg Mason (NYSE: LM). In May, the company announced a $1 billion buyback. At its annual meeting on July 27, Legg Mason announced it had already bought back $300 million worth of stock, a responsible repurchase of stock.

First, it made sure that it supported liquidity products and eliminated structured investment vehicles exposure. Next, it paid down debt obligations by making a successful tender offer for its equity units. After taking care of those obligations, the company realized its stock was still undervalued and began buying back shares at a good pace. Its $300 million repurchase represented 6% of outstanding shares.

Buybacks: The Bad
I get nervous when companies buy back stock at the same time insiders are selling and the stock price is rising. One such example is Netflix (Nasdaq: NFLX). In the past year (July 2009 to July 2010), insiders have sold $132 million of stock and made no purchases. Furthermore, the company is increasing the amount it is willing to spend on buybacks.

In 2009, Netflix bought back a record $324 million in stock. It even took on debt to finance these higher-priced repurchases. While Netflix's business and stock have performed exceptionally well over the past few years, it appears management might be being a bit reckless with its recent share repurchases.

Buybacks: The Ugly
The most egregious buyback situations usually show up in the related-party transactions, as listed in the annual report. Here's a past example from Fidelity National (NYSE: FNF):

In August 2007, FNF's chairman of the board, William P. Foley II, planned to sell 1,000,000 shares of FNF stock on the open market. Because the company was actively purchasing shares of treasury stock on the open market at the same time, the company agreed to purchase 1 million shares from Foley on Aug. 8, 2007, for $22.1 million, or $22.09 per share, the market price at the time of the purchase.

Fidelity National currently sits at just under $15 per share. I don't know about you, but I don't want an insider sitting on both sides of that decision. Is he serving his fiduciary obligation to shareholders or serving his best interests? It seems like an inherent built-in conflict to me. As it turns out, it seems like Mr. Foley the individual got the best of Mr. Foley the CEO on this one.

While buybacks are always pitched to investors as a wonderful opportunity to "return capital to shareholders," it's not always the case. They are only wonderful if the company has excess capital and is repurchasing shares at a discount to their intrinsic value.

Buck Hartzell owns shares of Legg Mason. Fidelity National Financial is a Motley Fool Inside Value recommendation. Netflix is a Motley Fool Stock Advisor pick. The Fool owns shares of Legg Mason and Fidelity National. Try any of our Foolish newsletters today, free for 30 days. The Motley Fool has a disclosure policy.