The current system (anything is open to change if it turns out too many ways to exploit it are found in beta):
You bring 10 troopers.
You build another 20 troopers.
You now have 30 troopers.
You lose 15 troopers.
You end the fight with 15 troopers.
Trooper survival rate of 50%.
Now that percentage is placed on the units you brought: 50% of 10 tanks = 5 tanks left on the (turn-based) strategy map.
This way you can never have more units left after the battle than you had before. The best you can do is 100% survival rate, which means all the units you brought survived and all the units you built survived.
Extra note: There is a survival rate per unit type. So you can lose all your troopers, keep half your hunters and have zero casualties on your juggernauts.