Banks provide free checking accounts because the banks earn money on your money you deposit through interest and by loaning your money out.
The way banks make money on free checking accounts is through the interest the bank earns on the money you deposit into your checking account.
This is one reason why some banks require you leave at least a certain amount of money in the checking account for them to keep the account open.
The more money you keep in your checking account the more money the bank earns on that money you have which allows them to keep your checking account open.
When you deposit money into the bank account your money does not just sit there in the bank but instead is transferred to other bank account holders and even loaned out.
However you still have access to your money even though the bank loans out money you deposit.
Some banks have checking accounts that pay you some interest as well and then some banks charge monthly banking fees to keep your checking account open.
Also if you overdraft your bank account then you get hit with fees as well so banks get rich off of those overdraft fees when the money is paid back.