Because they are taxed on annual profit, not capital gains. If they sell a stock and buy a different one, there is no profit.
The private analogy is a professional gambler. You don't pay taxes for winnings on each bet. You pay taxes on what you have cashed out at the end of the year.
Tax on individual sales is only a thing for individuals.
The bulk of the holders of stock in most public companies are institutional investors that don't need to pay taxes on the realized gains.