The secondary balancing segment can be enabled by assigning the Second balancing segment level while creating the COA Structure.
The intercompany lines will be generated if journal is not balanced by Primary or secondary balancing segment. For example, if primary balancing is same but secondary is different, intercompany lines will be created. If primary is different and secondary is same, then also intercompany lines will be generated.