Resin is also protecting against predators
Resin is important for the entire coniferous tree. This is because resin is a substance in the needles that spoils the appetite of predators. If, for example, a louse inserts its proboscis into the needle, the tree reacts. The liquid from the resin cells runs into the puncture wound and closes the hole. The louse often loses its desire or, if it is unlucky, sticks to it. The conifer tree reacts similarly to invaders in the bark, such as beetles. Once these bore into the tree, resin clogs the passageway and prevents them from advancing.
Beetles often also remain trapped by the resin as they retreat.