When you deposit money into a checking or savings account the money is posted to you bank account but any money deposited is usually invested in things such as stocks, bonds and anything else that will earn the bank money from your money.
Money you deposit is also loaned out to other people, businesses etc but of course you still have access to your funds but when the bank loans out money or invests money they earn money which is how the bank stays in business.