So what happens to the development studios of the games when their publisher goes bankrupt?
They attempt to seal a deal with another publisher to help with distribution etc.
If they can't, well they can sell what they have onto another developer under another publisher but that's a last gasp, generally.
Who decides what, I don't know, that will probably come under contractual agreements.