Resin is a sticky, aromatic sap or substance that some trees exude when their bark is injured. It's essentially the tree's immune system: a natural sealant and antimicrobial agent that protects it from fungi, insects, and environmental damage.
Resins are not the bark itself, but are produced from the bark or just beneath it (in the inner layers or "phloem"). Many essential oils and extracts are derived by distilling or solvent-extracting these resins.