Do companies that perform high frequency trades just have large enough money pool, or do they get money back quickly somehow?
Margin accounts do not have the problem you are imagining, which is unique to cash accounts
High frequency trades are intra day. The would buy a stock for 100 and sell for 100.10 multiple times. So If you start with 100 in your broker account, you buy something [it takes 2-3 days to settle], you sell for 100.10 [it takes 2-3 days to settle]. You again buy something for 100. It is the net value of both buys and sells that you need to look at.
Trading on Margin Accounts. Most brokers offer Margin Accounts. The exact leverage ratios varies. What this means is that if you start with 10 [or 15 or 25] in your broker you can buy stock of 100. Of course legally you wont own the stock unless you pay the broker balance, etc.
Purchases and sales from the same trade date will both settle on the same settlement date. They don't have to pay for their purchases until later either.
Because HFT typically make many offsetting trades -- buying, selling, buying, selling, buying, selling, etc -- when the purchases and sales settle, the amount they pay for their purchases will roughly cancel with the amount they receive for their sales (the difference being their profit or loss).
Margin accounts and just having extra cash around can increase their ability to have trades that do not perfectly offset.
In practice, the HFT's broker will take a smaller amount of cash (e.g. $1 million) as a deposit of capital, and will then allow the HFT to trade a larger amount of stock value long or short (e.g. $10 million, for 10:1 leverage). That $1 million needs to be enough to cover the net profit/loss when the trades settle, and the broker will monitor this to ensure that deposit will be enough.
As previously answered, the solution is margin. It works like this:
You deposit e.g. 1'000 USD at your trading company. They give you a margin of e.g. 1:100, so you are allowed to trade with 100'000 USD.
Let's say you buy 5'000 pieces of a stock at $20 USD (fully using your 100'000 limit), and the price changes to $20.50 . Your profit is 5000* $0.50 = $2'500.
Fast money? If you are lucky.
Let's say before the price went up to 20.50, it had a slight dip down to $19.80. Your loss was 5000* $0.2 = 1'000$. Wait! You had just 1000 to begin with: You'll find an email saying "margin call" or "termination notice": Your shares have been sold at $19.80 and you are out of business.
The broker willingly gives you this credit, since he can be sure he won't loose a cent. Of course you pay interest for the money you are trading with, but it's only for minutes.
So to answer your question: You don't care when you have "your money" back, the trading company will always be there to give you more as long as you have deposit left.
(I thought no one should get margin explained without the warning why it is a horrible idea to full use the ridiculous high margins some broker offer. 1:10 might or might not be fine, but 1:100 is harakiri.)