How do exchanges provide wallets unique wallets to users but also keep transaction fees low?

So I understand that exchanges don’t have to perform updates on the blockchain. However I’m not sure how they figure out the following solution without having to pay blockchain fees? I guess they do

i.e.

  1. An exchange gives 3 users, Bill, Jane & Sally a BTC address.
  2. Bill & Jane both send in 0.001 BTC to that address from a different exchange/wallet.
  3. Now Bill & Jane both send 0.0005 BTC to Sally on the same exchange. Same exchange so this doesn’t have to be on the chain.
  4. So now Bill & Jane both have 0.0005 BTC and Sally has 0.001 BTC according to the exchange. However both Bill & Jane’s actual wallet address still has 0.001.
  5. Sally now withdraws her 0.001 BTC

The exchange now needs to perform two blockchain updates to fulfill this withdraw which means two transaction fees on the blockchain for the exchange.

Does anybody know how exchanges do this?