if this is to be taken at face value, let me give you a life hack, there is a tree that dedicates the production of its bark to absolutely turn all ants away - needed for the survival of the tree. We use the bark of that tree to make cinammon.
SOOoooo, if you want nature's way of keeping ants out, just pour cinammon on their trails. They will hate you for it and you can begin winning the war!