Lets make a simple model: you trade against a market maker who makes two sided markets against the "cash" market based on one end user customer of the market makers bank (this could be say a big industrial company like say GM)
The prices they quote to you is based on the order flow they /know that the customer is giving them in the cash market. So you buy from their offer, they get to buy on their bid against the customer locking in a profit. The thing goes up and the process is reversed. You made money, the market maker has made money and the customer has paid you both. However the customer has not lost, they were just hedging their cash flows over seas. So ultimately its the guy on the street buying a car that pays.
Now in the real world this is not as simple, the market maker probably does not know what his order flow is on the other side, but he can make an educated guess. Furthermore, he does many trades at the same time in many pairs/instruments so there are likely never a clear cut arbitrage, just edges.