When your Troops are wounded in Battle, the Hospital is where you can heal humanoid troops and repair mechanical troops.
When Defending, your troops will default to Wounded and be sent to the Hospital to await Healing. However, your Hospital's Capacity is limited. If you are attacked again while your Hospital Capacity is is full, your defending troops may die.
You may upgrade your Hospital level and research relevant technologies to raise the max capacity of your Hospital.