Banks are like any other store; it is just that their product is money. Think of it this way. They loan out money to people, but they charge an interest rate. This is where they make most of their money and if you think about how society works, then the whole world is based on credit. For example, very few people buy a car without a loan. They get a loan and it is financed. The bank puts up the money to the car dealership and the owner of the car pays monthly with interest. This interest is profit for the banks. The same holds true for homes, but the loans are bigger.
Banks also make money, because if customers put money in banks, they get only a small interest rate. In other words, the interest that they charge is always bigger than the interest they give. Right now, I am getting less than 1% on my savings account, but I am paying 5.5% for my car. The bank wins out.
The banks also take on risk. If people default on their loans, then the bank looses money.