How this is managed is by making sure you have enough capital on hand or in assets you can liquidate immediately to cover customer withdrawals, which wasn't possible for SVB because 20-30% of their total customer deposits were leaving each day by the end. In that regard it is true that the bank run caused the failure. However, what caused the desire to get out is bad management at the bank and unrealized losses because the bank had a large portfolio of mortgage backed securities they weren't required to mark to market (thanks dumb regulators) and the loss on them from the sudden increase in interest rates was large. In addition they had a very large portfolio of loans to startups that were questionable given the massive shift in that market so there really is a big question mark on how many billions that portfolio would be down which makes it really questionable whether the bank was actually solvent or not and that drove the panic to get out.
So the correct answer here is the regulators screwed up allowing losses to not be marked to market, the bank management screwed up exposing themselves to a very risky duration mismatch and very risk asset mix and when the bank customers figured it out they caused the bank to officially fail by trying to protect their assets by moving them elsewhere.