After a  run-up into its recent earnings, Ubiquiti Networks (NASDAQ:UBNT) stock sold off hard following its earnings report, dropping from $64 all the way to just below $47 in the weeks following the Feb. 9 report. The sell-off was quite severe, considering the numbers were not all bad. While missing earnings estimates, the company did beat estimates for the top line, when many companies, especially those that sell internationally, as Ubiquiti does, are struggling with the strong dollar. 

On March 3, the company announced it had authorized a new $50 million buyback, as it had spent its previously authorized $50 million authorization during the third fiscal quarter, which ends on March 31. It looks like the company was buying back shares quickly and aggressively after the stock's precipitous decline. Should investors be cheering, or nervous?

The buyback debate

In his recent shareholder letter, Warren Buffett tackles the issue of share repurchases, a topic that has engendered serious debate in recent years. Some claim money used for repurchases detracts from capital projects that will garner returns in future years. Others claim buybacks prop up stock prices, and therefore, executive bonuses, while taking away from laborers that could be working on new products or ideas. Still others prefer excess cash returned in the form of dividends, especially those in or near retirement who seek to use the income.

For Buffett, however, the matter isn't so complicated. As he wrote in the letter:

If there are three equal partners in a business worth $3,000 and one is bought out by the partnership for $900, each of the remaining partners realizes an immediate gain of $50. If the exiting partner is paid $1,100, however, the continuing partners each suffer a loss of $50. The same math applies with corporations and their shareholders. Ergo, the question of whether a repurchase action is value-enhancing or value-destroying for continuing shareholders is entirely purchase-price dependent... When CEOs or boards are buying a small part of their own company, though, they all too often seem oblivious to price.

It is true that many companies regularly declare how much of their stock they are going to buy back far in advance. To Buffett, it doesn't make much sense to proceed with the buyback regardless of price. (Ubiquiti did note that "the timing, manner, price and amount of any repurchases will be determined in the Company's discretion and the New Program may be suspended, terminated or modified at any time for any reason. The New Program does not obligate the Company to acquire any specific number of shares...")

Still, logic does not always rule the day in corporate America. After all, there is a strong imperative for executives to project optimism about their company, to ease the minds of their shareholders, employees, customers, and their own egos. This optimism is no doubt helpful in getting up every morning and going to work to build a better company.

But this leads to a dilemma regarding buybacks. If you think your company has an extremely bright future (since, you know, you are the guy or gal running it), aren't your shares always undervalued? In that case, should you not be buying back as much stock as possible? The recent era of record low interest rates and cheap debt have poured further fuel on the fire, as corporate executives had access to extremely cheap money with which they could buy back shares.

A tale of two buybacks

Buying back shares regardless of price, however, can lead to a dangerous result. In the example below, look at the chart of Viacom (NASDAQ:VIA). Here, we see Viacom's share repurchase moving in lockstep with its stock price.

VIA Chart

VIA data by YCharts

This is not what you want to see, as prior-year repurchases were done at a much higher price. At the same time, Viacom's Debt-to-EBITDA ratio ballooned as its cash on hand diminished.  

VIA Cash and Equivalents (Quarterly) Chart

VIA Cash and Equivalents (Quarterly) data by YCharts

Unsurprisingly, Viacom had to cut its dividend, and now must focus on reducing debt.

When looking at Ubiquiti Networks' repurchase chart, however, a different picture emerges.

UBNT Chart

UBNT data by YCharts

Here, buybacks have historically been negatively correlated with the stock price. The company has been aggressive when the stock is in a trough, and has eased off buybacks when the stock has run up. This more efficient use of cash is what investors should prefer to see. As a result, the company has been able to reduce its shares outstanding by over 10% in the last five years, while still increasing its cash position. 

UBNT Average Diluted Shares Outstanding (Quarterly) Chart

UBNT Average Diluted Shares Outstanding (Quarterly) data by YCharts

While no one can tell the future and it remains to be seen if Ubiquiti's stock price will rise, the history of management's repurchase allocations is encouraging. If Ubiquiti's recent margin headwinds prove to be temporary, today's current buyback will be value-enhancing.

As Buffett said, "Before even discussing repurchases, a CEO and his or her Board should stand, join hands and in unison declare, 'What is smart at one price is stupid at another.' "

Billy Duberstein owns shares of Ubiquiti Networks. The Motley Fool recommends Ubiquiti Networks. The Motley Fool has a disclosure policy.