Simple Answer: Banks give you whatever a good interest rate is (for the past few years 1% or less) and then lend your money out at 4-5%. Creating a spread of 3-4% of a delta or arbitrage.
Long answer: Banks are an awesome example of capitalism. They are able to use supply and demand in a way that makes them money at the same risk levels that we invest. The main difference being that we are incentivized to pay them back (credit scores follow you around for life). In some cases we have physical property that can be taken if we don't pay our debts. In others we face the penalty of having a decimated credit score. Either way, fear of losing something (property or lower interest rates) works in a bank's favor.
The Fed requires banks to have a certain percentage of their customer's deposits in cash mostly in case of a "run on the banks" emergency. What do you think they do with the rest of the money? They lend it out!
For instance, where there is a physical property used as collateral, they assess a lower interest rate than if it were unsecured debt (i.e. credit cards). A prime example is with mortgages. You don't pay...you lose your HOME.
Once banks have satisfied their requirement of customer cash deposits, let's say it is 30%, they lend out the other 70% to other customers. For mortgages the difference may be 3-5%. For credit cards the difference could be approximately 20%!
This is why they can afford to pay you a measly 1-3% on your savings account (it's less than 1% now). They are essentially paying you $1 on your deposits, and making $19. This huge "delta" is why most financial planners encourage you to have your emergency funding in savings but the rest of your liquid net-worth in investments working for you. Most savings accounts are getting eroded by inflation. If inflation is 3% on average and your bank is giving you 1% interest on your savings account, every dollar in that account is worth on average 93 cents after one year.
What are your thoughts? Do you believe a savings or checking account is the best place for your hard-earned dollars?