Hi there,
The STP root is selected based on the Bridge-ID value (a combined value of switch priority and MAC address).
When you configure spanning-tree vlan <vlan_id> root the priority value is changed from the default 32768 to 24576.
When you configure spanning-tree vlan <vlan_id> secondary the priority value is changed from the default 32768 to 28672.
By using these commands within the network, assuming STP priority values have not been changed elsewhere in the network for the specified VLANs it makes the STP convergence process more deterministic.
cheers,
Seb.