This apparently is a problem on Mastodon. But, the Forumverse (PieFed/Lemmy/MBin) has a design that mitigates this.
See for example the case of lemm.ee. It went down. Yet, here's an example of its content being live and (somewhat) kicking: https://lemmy.world/c/movies@lemm.ee .
Their closure was known before, so communities names were appropriately changed.
How the Forumverse works is that each instance that has at least one user subscribed to a comm makes a full copy of all of the comm's text material whenever something gets published there. What, however, goes missing is the ability to propagate the content between instances. That would be the job of lemm.ee, in this case. If you now go and write a comment at https://piefed.social/c/movies@lemm.ee , it will never be visible when viewed from within other instances. In other words, whatever you comment there, will not be visible on https://lemmy.world/c/movies@lemm.ee, because you are not a user of lemmy.world and nobody's there to federate the content.
I wish Forumverse comms had some kind inheritance tag so that a comm could tell what instance should gain the right/responsibility to do the federation work if the comm's original instance is confirmed to have gone belly-up. If that was done, comm's would be essentially eternal. Now it's a bit of a weird situation that you have comms that look completely existant and where it looks like you can even comment, but the comments won't propagate anywhere.
But the content is still there. If you subscribe to a community, it means all of that community's text content (but not images!) will be backed up on your home instance's server.