For its protection, and for what else, the tree gives off such a yellow liquid - gum. It is viscous and dries up over time. And people have learned how to use it in the national economy and most likely specifically damage the trees to get this substance ...
Gum, gum (from Greek κομμίδιον, κόμμι) is a high-molecular carbohydrate, which is the main component of exudates (phloem juice, effusions) released by plants during mechanical damage to the cortex or diseases.