The initial way to view the stock market is as a zero-sum game. With any stock trade, one side wins, because it buys a security that increases in price, or because it sells one that declines. The other side loses, by the same amount. In aggregate, then, the stock market's collective trades amount to nothing at all.
However, this approach ignores costs. The two traders will lose the difference between the stock's bid and ask price, which accrues instead to the stock's market maker. (The trade will also generate a brokerage commission.) In addition, if the traders are professional investment managers, they will charge a fee for their services. In aggregate, then, the game does not sum to zero--it is negative because of expenses.