To protect the plant by their antifungal and antibacterial nature
Resins and complex combinations of terpenes are released by some plants and trees, such as evergreens, to act as antimicrobial, antifungal, and antibacterial agents against a wide range of organisms that may threaten the survival of the plants. Compounds such as sesquiterpene lactones found in plants such as feverfew, yarrow, and blessed thistle, have been found to play a strong antimicrobial role as well as a protective role from herbivores.
To play a role in allelopathy, a type of plant-to-plant competition
Allelopathy occurs when a plant releases chemicals to prevent competing vegetation from growing within its area or zone. An often-cited example is in southern California, home to the dominant shrubs Salvia leucophylla (sage bush) and Artemisia californica (a type of sage). Both species release allelopathic terpenoids, eucalyptol and camphor, into the surrounding area, which effectively prevents other plant species from growing around them. This is allelopathy. Chemicals that deter competing growth (terpenes, for example) are referred to as allelochemics.
To attract pollinators and dispersal agents
Insects have been pollinating flowers for over 200 million years. Insects, like humans, are attracted to specific plants for one of three possible reasons: its aroma, its color, or its morphology or physical structure. Scent appears to be more ancient than flower color as an attractant to insects. Various insects, including bees, butterflies, and even beetles, are known to be attracted by the aroma of a plant.
To serve as defense compounds against insects and other animals
Plants, like other living things, need to protect themselves from various types of predators. Plants use terpenoid compounds to deter insects and other animals from approaching them. Shawe pointed out that “insects are very rarely found on peppermint plants and the presence of linalol in the peel of citrus fruits confers resistance to attack by the Caribbean fruit fly.” The Douglas fir tree releases a complex mixture of volatile oils, or terpenes, from their needles to defend against the spruce budworm. Even more fascinating is that the Douglas fir trees “will vary the composition and production of terpenes each year thus decreasing the ability of the budworm to develop widespread immunity to specific compounds.