Units that were hit in battle are recorded as “wounded” and will go to your monastery. You can’t use them for attacks, and they won’t defend you until you heal them.
 
You have to unlock your monastery first to heal units. 

If your monastery can’t hold more units, all other affected units will die and be recorded as “killed” in the battle. So make sure you always treat the wounded in order to save your units, so they can join your army again.