For example, Linus for Linux, or Guido for Python, if they were suddenly and unexpectedly unable to perform their duties.
If you care a lot about a specific project and want to prepare then it's similar to preparing for any other disaster.
* Documentation and written processes for everything. People like to feel irreplaceable, but it's far more valuable to make yourself unnecessary. In high stress situations, people make bad decisions, so having well-oiled play books is important. E.g. see [0].
* Practice and simulations: at large companies people are sometimes put on surprised forced vacation and are not allowed to communicate with their team.
* Foster a culture of encouraging people to step out of their box - if Important People's decisions can be questioned, then the rest of the team will better understand them and will be able to cope better with making them if necessary
[0] https://www.atlasobscura.com/articles/pointing-and-calling-j...
Ask a small dev team "what would happen if the main technical person left suddenly?", and they'll normally tell you the companies product would collapse.
But when that happens, the usual outcome of a key person leaving a small team is usually that the teams productivity is reduced for a few months while someone new is found and fills the space.
Basically, decentralization. There can still be the Dev X who knows it all but everyone else should be able to maintain and evolve various pieces of the system should the need arise.
They're still up and running and doing really well.
Edit: So it doesn't seem like this is because I documented everything well and code was good. That wasn't the case. They just managed.
But for software engineering in general, you want a culture of people focused on working as a team towards the mission, not on individual metrics/career. This affects what you do, how you to it, how you document it, how you make decisions, etc. If there's no immediate plan for what to do when the lead dev not available, they'll figure it out.
Responsibility for various sub-systems is already distributed to many individuals. As for overall responsibility to maintain the canonical tree and merge patches in, it'll probably similar to the last time Linus stepped down for personal reasons. Greg Kroah-Hartman handled the 4.19 release of Linux while Linus took a break.
Apparently not the walrus.
As a Lead:
When my wife had heart problems, I instantly told my team to go on auto-pilot, who would run their ceremonies, and went to support my wife. When I got called by someone with a question that was answerable by my team, I chewed them out. This is all with 100% support from my director.
As a developer:
I'm working on a product where the product has been developed by one dev largely for many years. I'm at the 6 month mark now, and honestly, if I had to step up to support everything myself, it'd suck, but the company would keep going. Would I have to change how a few things work? Probably. But would we get our releases out: Absolutely. Usually at 6 months, I could take over most products but this one is very specialized. (Which is why I joined up. I knew the ramp was longer, and I had more growth. :) )
And that is the real story: If you want to get that "truck number" up. Get someone else into your codebase, and working. If not expect some lag while they come on-line, but that the world will keep spinning.
... Also look for people who can learn, over just raw skills in a replacement scenario. Clearly they need to know enough, but it may take you longer to find someone who can check every box, than get someone and have them ramp up to "good enough" quickly, missing a piece or two. Heck you might want 2-3 developers.. something about learning your lesson.