An insolvent bank, having made bad investments, is incapable of repaying depositors.
Guarantees
Small depositors are guaranteed to get their money back, up to a certain limit- usually by government agencies. But, such guarantees do not protect big investors.
Economic consequences
Bad money lending leads to ruin of the lender; sometimes selling ownership of these loans on the stock market, they bring ruin to others: 2008 financial crisis resulted from bad housing loans in USA, for example.
Failure of banks also leads to a credit-crisis.
Government rescue
The government, is motivated to rescue banks - to maintain GDP growth. This has been true since Roman times. Means of rescue are described for businesses in general elsewhere.
Nationalization
This involves stock injection by the government. When many banks are insolvent, the timing becomes important - all banks should be nationalized at the same time, in order to prevent panicked withdrawal of deposits from banks which are yet to be nationalized because nationalization indicates that the bank is insolvent, and depositors may suspect that the government may be incapable of rescuing it.
This nationalization is usually meant to be temporary - governments ideally find new buyers as soon as possible. But this is difficult when many banks are insolvent.