if you surround a unit then they cant move in a direction without coming in contact with your troops, thus they have to fight. Also surrounding a base only allows them to build one unit on the base square as they cant jump enemy troops to deploy units