Banks borrow short and lend long. So if all of a bank's depositors suddenly want their money, the bank would be unable to pay them. A bank may have made great loans but it can only unwind these loans slowly over time.
In most situations this doesn't matter. Banks know their cash flows and play the probabilities, making sure they have a buffer of liquid assets to meet normal withdrawals.