Not sure who "you" is but the company will have fewer shares outstanding, investors who don't sell will have the same and those investors will also now own a greater % of the company as well as a greater earnings per share.
> If you "reinvest" in the company you give up all the proceeds you received to buy back the shares that you just sold to the company
I am 100% not saying that as that would eliminate the benefit. The benefit is to long term investors who buy, hold and reinvest dividends and reinvesting dividends to buy more stock is key as that is where the historical exponential returns are because it increases your ownership share and future dividends.
That is where my example numbers come in because you can only reinvest to buy more shares and thus your ownership % the dividend amount minus tax amount whereas the company can spend the entirety of a dividend buying shares to remove them from the outstanding market. The difference between those two numbers (1.05 and 1.04 in my example) then compounds and effectively goes towards increasing share prices which do eventually get taxed but they get the benefit of compounding while the owner holds.
Also, while you need quite a few shares, you can estimate and sell the percentage of shares a company is buying back in order to keep the same % ownership thus acting like a dividend so I myself would prefer all companies I invest in to never give out dividends and only do buybacks unless their P/E ratio is truly absurd.