If a broker is properly regulated, following the rules etc., there are at least 2 ways it makes money. One, through commission, two, reselling.
A broker does not act in the same way as a trader. A trader may be a customer of the broker, and the broker may have many customers.
The broker may have a supplier from whom the broker buys from or sells to. If the broker can get his goods at say, bid-ask: 8-9, he may quote at 7-10 making one pip from each side.
If one pip is $10 and each of his customers trade once a day, opening and closing their positions, the broker makes $20 from each customer, regardless of whether the trader wins or loses. If the broker has 1000 customers each trading once a day, then the broker makes: 1000 x $20 a day = $20000 a day.
The purpose of the broker is quantity of trades, whereas the trader's purpose is quality of trade. The more the traders trade the richer the broker gets, regardless of whether the trader wins or loses.