When you possess a large portion of territory, a secondary headquarters can speed up operations. As its name implies, the secondary headquarters acts in every way like your central headquarters, except that it does not generate resources on its own. But it can still send out engineer trucks, and receive supply convoys. If your second headquarters is closer to a supply depot than your original HQ, or closer to the intended location of a new building, supply convoys will be routed to it and engineer trucks deployed there, respectively. However, the secondary headquarters has a much more important feature that makes it valuable.
If your primary headquarters is destroyed or captured, you retreat to one of your secondary headquarters, from which you can continue to field units and construct buildings. But if there is no secondary headquarters to fall back to, you'll have no choice but to surrender.