It’s very common for a larger bank to buy out a smaller bank, even if it is nominally bankrupt. Sometimes the government steps in and helps out by providing various guarantees or short term funding. This is nominally a bailout, but may actually save taxpayers money by not having to involve the FDIC. See: WaMu being bought out by JPMorgan Chase for $1.9 Billion in the 2008 crisis.