An active Shield will protect your base against other players's attacks. Very important! You lose your Shield if you go to attack an opponent, while it's an active. However, campaign missions do not deactivate the Shield.
If your base is attacked and destroyed, you automatically receive a free Shield. The duration of the Shield depends on the base destruction degree: from 1 to 14 hours.