Cash is an asset to the bank. If you give $2000 to the bank, they have an asset ($2000 cash) and a matching liability (they owe you $2000).
They either keep that cash to use for a withdraw or can swap it at the central bank (the Fed in the US) for central bank reserves.
Each bank has an account at the central bank, which they use for settling transfers. There are various ways for banks to send instructions to a clearing house (like ACH, Swift, etc.) but at the end of the day they settle the difference by transferring central bank reserves between their accounts at the central bank.
Here's the important part - since banks are transferring both ways between each-other, generally the amount of reserves transferred between them is some fraction of the total amount being credited to each account. For example, if bank A needs to give bank B $100 million, and bank B needs to give bank A $99 million, then only $1 million actually moves at the end of the day. So banks don't need to hold anywhere near the full amount of deposits in reserves. If they don't have enough to make good, they borrow if from another bank, or the lender of last resort (the central bank itself). For this, the CB charges them the official interest rate.
Anyway, that's how banks are able to create money to lend. Since money lent becomes a deposit, lending from existing deposits doesn't work if you want to follow the laws of double entry accounting. Instead, the bank creates an asset (the signed loan contract with you) and then deposits your account (creating the matching liability), creating new bank credit (which is considered money by people and the Government, even if taxes can only be settled in cash or reserves) as well as debt.