What you're describing is a service provided by a bank called a safe deposit box, which banks provide as a fee service. This is quite an archaic view of banking services.
The most basic commercial bank today makes car and home and small business loans using the funds deposited by its clients, and it holds those funds 'for free' (in the 1980s in the USA, one could make 5% interest by depositing one's cash in a bank savings account, with perhaps some penalties for withdrawal, IIRC). The bank charges a greater interest rate to those who take loans from the bank and pays out a lower interest rate to those who deposit funds with the bank, and that difference is where it earns its profit margin.
People tell me this little fairy tale has very little to do with the majority of the profits 'earned' in the modern banking system, however. It seems to have something to do with the merger of investment and commercial banking post repeal of Glass-Steagall laws separating those two sectors.
Curiously, nobody seems to want to talk about the strength of the dollar being backed up by petrodollar recycling since it went off the gold standard... but hey, who cares, we're fighting a war with Russia in Ukraine over access to the European gas market for just that reason, and the expenditures in Ukraine ($100 billion) seem comparable to the expenditures looming to make good the depositors in SVB and co. ($100 billion?) and these two things must be completely unrelated... I guess.