If you have troops in your Squad Center when you are attacked, those units will join in the defense.
This is especially useful against strong units such as Wookies/Tanks/Heroes. Since most of the strongest attacking units typically target Turrets first, the attacking units will ignore the defending troops until all Turrets are destroyed. The defending troops will get free hits for majority of the battle. Soldiers and Stormtroopers are especially useful for defense because although they have relatively low Health, they have high DPS per troop.
So instead of using up the requested troops for attacking, try to save them for defense. Don't forget to request more troops once they are used up.