Tree sap serves to transport sugars and nutrients throughout all trees, but resin primarily exists to protect evergreen trees from injury, insects or pathogens. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.