A smart tree

Long ago, the Cecropia tree, which grew in a tropical climate, was attacked by the ivory and all kinds of insects. So that every year he had to fight like a lot of misery for his survival.
You think such a tree can't think because they don't have a brain. But somehow they can still convey intentions. Perhaps they do it by transmitting what they want in a telepathic way. Either they spread a scent or they create something really nice that they display on their branches or stems
The latter did the Cecropia. He somehow realized that the Azteca ants who saw the tree as their home were fond of sweet juices.
And once, with the help of the sun and CO2 from the air, the Cecropia succeeded in producing a very sweet juice. She released it in drops at the roots of its branches. The Azreca ants immediately hit the scent she added to it.
Comment with a minimum of 10 words.