They go bankrupt? As I understand, Silicon Valley Bank had too much of its assets tied up in lower-rate loans and such assets. When the inerest rates jumped significantly and fast, they could not adjust fast enough.
Seriously, though, this is why the spread between the prime rate and what you can borrow at and what your deposits pay interest at. If that changes a ridiculous amount, the banks are in trouble. It also explains why variable rates, which adjust with the central bank rate, are lower than fixed - less risk. The central bank also requires local banks to keep a certain amount of money on hand liquid to ensure market “wobbles” don’t cause the bank to have a cash flow problem.
(Aside - generally, rates don’t change fast and furious, are pretty stable. The last year may be an instructional time for financiers. It’s also why we are in this predicament. After 2008, once the economy was stable, central bank rates should have gone back up to a reasonable number -say, 2% or 3%? But it seems it was never a good time to raise rates… so now it’s a shock when we do. Also, virtually zero rates distorts the market, driving investors to find anything else that pays better - driving up those subprime mortage bonds, the stock market, real estate, whatever pays better than zero percent.)
In Canada, most mortgages are term - you sign up for, say, a 20-year mortgage but have a term - say, 5 years. When it’s up, you have to renegotiate a new term. So banks are rarely worried about anything longer term than 5 years. I was told the opposite applies in the USA - your mortgage, unless you refinance, is fixed for the life of the mortgage.
In many cases, especially mortgages, loans are such that paying off early incurrs a penalty to make up for the disruption and loss of future interest. For a mortgage, if the interest rate difference is not too large, the bank may forego that penalty to keep you as a customer. Plus, as mentioned, there are additional expenses that may be applicable in a refinance.