It is performing a caretaker function for you. Never try to eliminate ants from the inside of trees, they are sending a signal that the tree is in danger and ill health. Some gardeners see an ant hill in their lawn and react with panic. Again, the ants in lawns are not creating a problem in healthy grass. Both you and the ant colony will appreciate this benign neglect.
Some gardeners see ants scurrying around on the paving stones on patios or driveways.
This is a pain in the garden as they can undermine the stone foundations. Slowly pour boiling water down the ant hills. If poured very slowly, the hill will likely die. It may have to be repeated several times but eventually the nest will die. This resistance to being killed is quite noticeable in all control systems.