Let's say I'm a fledgeling lemonade stand and I want $10 of investment. You give me that $10 and with it I make $15. You wanted a 10% return on your investment so you get back $11.
With this model, you have "created" $1 in investments. That $1 originally came from the $15 I made with my lemonade. And all those $15 were exchanges for convenience or sheer happiness gained from having lemonade.
So no one really "lost" in this scenario. But I think the finance people call this "creating wealth". Vs other scenarios, where if you invest in someone who is bad at selling lemonade, you only get $8 back, now you have lost $2 from your initial $10. The idea is to continually "create" wealth by making good choices, investing in good lemonade stands vs bad ones.
So when someone says x-machination (high frequency trading) has "made" $5B, there isn't necessarily a loss anywhere. That's just how much that came out on top.