Banks play a statistical game. Let's take the more general case: Suppose you deposit $10,000 in the bank. Does that mean that the bank puts your cash in an envelope and stores it in the vault? No. They loan the bulk of that money out to other people -- home mortgages, business loans, whatever. So what would happen if tomorrow all the depositors showed up at once wanting to withdraw their money? The bank doesn't have the money, it's all loaned out.
In practice, the bank knows that this isn't going to happen. Over time they've figure out what percentage of people are going to show up to withdraw money on any given day and how much they will withdraw. So they keep "reserves" adequate to handle any likely amount. Banks make arrangements with other banks so that if they get an unusual number of withdrawals one day, they borrow the money from another bank in an "overnight interbank loan". Note that the bank doesn't have to know when you specifically will withdraw money. They have many thousands of customers. They just have to know how much the AVERAGE customer will withdraw each day.
A hundred years ago, if many people tried to withdraw their money all at once from many different banks, the system broke down. This was called a "run". It's part of what went wrong during the Great Depression. Today the government guarantees most deposits, so if your bank really does run out of money, the government will make it good. There will be a delay while they go through all the paperwork, but you'll get your money.
Getting back specifically to credit cards: If you have a $10,000 credit limit, the odds that you will go and run up to that limit tomorrow are small. The bank knows how much the average customer will spend each day and how fast they will pay it off, so they can keep sufficient cash on hand to pay any charges.
Oh, and when I say "cash" here, I don't mean necessarily green paper and coins. Most of the cash in the US today is electronic money, that is, the bank just has stored on their computer somewhere that you have $X. If you pay for something with a check or debit card, they don't take green paper out of your envelope and mail it to the store. They subtract from the number stored on the computer for your balance and send a message to the store's bank telling them to add to the number for the store's balance. If you pay for something with a credit card, they add to the amount you owe and send a message to the store's bank to add to the amount in their balance.