There’s a company worth $50, that has 10 shares each worth $5. The company ends the year with $10 in profit, so instead of giving that $10 to the shareholders as dividends (which are taxed as income), they spend that money to buy 2 of the shares. Now there are 8 outstanding shares but the company is still worth $50, so each share is worth $6.25, and the remaining shareholders have the choice of when to sell their shares and realize their gains (which are taxed as capital gains, which can often be lower).
TLDR: Like 90% of finance and accounting, its about paying less taxes.
Latest Answers