When a stock is undervalued, one of the more intelligent things that a management team can do is repurchase the stock. If a stock is worth x but trading at 0.85x, a stock repurchase gives you an immediate 15% return (on this, reality is harsher than theory because corporate executives are biased to always think that their stock is worth more than the market quotation suggests.)
When a stock is overvalued, the intelligent course of action is to acquire other companies and issue your own stock as compensation. This is because part of the value that you are transferring will soon prove illusory. If your stock is worth x but is trading at 1.15x, a stock merger will really cost you 15% less than a cash merger.