Also, such risks can be insured.
Also, such risks can be mitigated in various ways - I recall having a contract where the source code of any product version delivered to us would be held in escrow at a third party, and in case the supplier went out of business or a bunch of other conditions, we'd get their code and legal rights to use/modify/maintain it ourselves or through some contractor.
A contract is between you and some entity - if you want to protect yourself against that entity "dying", then that can be done by a contract with someone else (e.g. insurer, escrow, etc) who can make you whole even if that entity is dead.
Contracts can be valuable but often they are over valued.
Companies also are not physical items that can disappear due to natural disasters.
The only ways they can disappear is by closing down, and that does mean honoring contracts, and by going bankrupt and that means using all leftover assets to satisfy all the parties whose contracts you’re breaking. And no, you can’t just transfer all assets away and leave a shell to go bankrupt because that is fraud and the judge can nullify the transfers.