Recess appointments
Exactly. By law, there is a very well defined list of successors to the Presidency, and I believe that it has been policy for a long while to not have the whole list in one place at any point in time.
Whoever becomes President immediately does recess appointments for all dead cabinet officers and Supreme Court justices, and permanent appointments get sorted out at leisure when Congress is able to operate again