I just looked this up out of curiosity. These ants cut pieces of leaves off, store them and use them to grow fungus. They then eat the fungus. This is very cool
When the tree has had enough of getting eaten alive by ants, it starts producing a compound that will now damage the fungus instead of help it grow, in order to convince the ants to leave it alone.