It helps if you think about it in accounting terms where assets minus liabilities needs to add up to zero. When a bank makes a loan for $100 it adds $100 to the balance in your account - which is a $100 liability - and the $100 loan to its assets, balancing the books. Bank deposits aren't stores of physical cash, they're numbers in a ledger indicating what the bank owes you, and when you get a loan it means the bank owes you more money and not that it owes anybody else less money.
This Bank of England paper is by far the simplest and best explanation of the whole process, well worth a look even if just for the summary on the first page :)
https://www.bankofengland.co.uk/-/media/boe/files/quarterly-...