It appears when the three following conditions are met:
- Your troops are attacking the enemy HQ,
- They are not under fire themselves,
- There's enough time for them to destroy the HQ.
The button does not give any advantage to the player — it simply saves time, when the outcome of a battle is 100% obvious.