So suppose the bid for some particular stock is $100.00 and the ask is $100.10 in both Chicago and New York. They could be different between the two exchanges, but the prices between exchanges will generally be the same or very close to each other at any given time because any significant divergence is an arbitrage opportunity.
Now somebody wants to buy some shares of that stock in Chicago, so they cross the spread and put in a bid for $100.10. They immediately buy all the shares in Chicago that are available at $100.10. Now the ask in Chicago will go up because all the shares available for $100.10 in Chicago have been purchased, so now the bid in Chicago is $100.10 and the ask is, say, $100.20. At the same time, in New York, somebody wants to sell some shares of the same stock. So they cross the spread and make shares available for the bid price in New York, which is $100.00. That seller sells to everyone in New York who is willing to pay $100.00, so now the ask in New York is $100.00 and the bid is, say, $99.90. Both the buyer in Chicago and the seller in New York are still willing to buy and sell more shares at $100.10 and $100.00 respectively, i.e. the new bid in Chicago is higher than the new ask in New York.
The HFTer sees the new prices before most other traders because their computers are faster and closer to the exchanges. As soon as the buyer at $100.10 learns there is a seller at $100.00 or vice versa, they would get together and trade all the shares they want to trade at some price in that range. But the HFTer learns the pricing information first and, before the buyer and seller find out about each other, the HFTer buys the seller's shares in New York at $100.00 and immediately resells them to the buyer in Chicago at $100.10.