My (limited) understanding is that dividends and share repurchases are economically very similar: while share repurchases are slightly less direct, both transactions are effectively ways for publicly traded companies to transfer wealth to their shareholders.
From what I can tell, the only real difference between these two transactions is the way that the tax code treats them: (non-qualified) dividends are taxed as ordinary income, while the gains resulting from share repurchases are taxed as capital gains. Companies often prefer to make share repurchases because they are effectively taxed at lower rates.
It seems to me that there's a likely inefficiency whenever effectively equivalent transactions are taxed at different rates. Is there some important difference between dividends and share repurchases that I'm missing that justifies the tax code's differential treatment?