When your ships are damaged in battle, they’re sent in your Repair Facility. But it only has so much space. If every berth is taken, those damaged ships will be destroyed instead and lost forever.
It’s best to upgrade your Repair Facility on a regular basis so that you can increase the capacity before you need it.