Troops that are lost in battle need to be replenished, and this takes time. If you lose a lot of troops, you won't have a big army available for your next attack. This will limit the bases you can attack next. A lot of the information in this guide will help you to conduct your attacks with minimal losses (better tactics, units, heroes, relics, etc.)
If you lose a lot of troops, it may be tempting to use Machine Spirit to speed up the replenishment. This is not recommended as Machine Spirit is a very valuable resource and should be used elsewhere. If you follow the tactics in this guide, you should be able to continue attacking even if this happens.
You can watch a video to replenish all your troops instantly. Use this only if there are no bases that you can attack with your current army as you won't be able to use it again for another 4 hours. But it can be a good way to continue playing where you might otherwise be stuck.