The business-building is not zero sum, but the trading is zero-sum, and the societal purpose of the thing is to provide liquidity
Derivatives (options, futures, swaps, etc) are a zero sum market, there is always a winner and a loser necessarily because the contracts have an expiration date.
The same is not true for trading equities, they are not zero sum. There are dividends, buybacks, companies will sometimes spin off a part or parts as separate companies that you get newly issued shares of stock from (GE splitting into parts is a recent example), public companies get taken private at a premium to the market price, etc.
theoretically equity trading is about distributing stonks most optimally so that productive companies get more and less productive ones get less, improving productivity of society as a whole