In the case that none of the above is possible the institution will probably try to do right by the student, but it's a bit of a crap shoot. Even if the institution confers the PhD, the student is still beholden to the publish or perish culture of academia - and their (former) advisor would have helped navigate them to a thesis which their former advisors peers would accept. If the latter doesn't occur in a big way; then the student won't have a good career ahead.
I've known 1-2 people who for various reasons decided that the grad student life was the optimal career station for themselves as it provided the benefits of an academic career without the overhead of grant applications etc.
Generally, for retirement, faculty try to "draw down" their labs, and there's very often a "I'm going to see X student through to their defense, and then I'm done" as the end of an academic career.
For unexpected deaths, generally there's a scramble to help cushion the students, get them in with new advisors, etc. But often, their former advisor's grants, data sets, etc. are still available. Unless one is really early in the process, the goal is to help the student finish their current work in a timely fashion.