To deter herbivore attacks, plants employ a diverse array of volatile compounds, particularly during the early developmental stages. The highly expressed genes LaTPS7, LaTPS8, and LaCYP71D582 were identified during the budding phases of Lavandula angustifolia. In vitro studies revealed that LaTPS7 generated nine distinct compounds, including camphene, myrcene, and limonene. LaTPS8 enzymatically converted eight volatiles by utilizing geranyl diphosphate and nerolidyl diphosphate as substrates. Overexpression of plastid-localized LaTPS7 in Nicotiana benthamiana resulted in the production of limonene. Furthermore, the endoplasmic reticulum-associated enzyme LaCYP71D582 potentially converted limonene into carveol. In N. benthamiana, LaTPS8 is responsible for the synthesis of α-pinene and sylvestrene. Furthermore, leaves transfected with LaTPS7 and leaves cotransfected with LaTPS7 and LaCYP71D582 exhibited a repellent effect on aphids, with an approximate rate of 70%. In comparison, leaves with an empty vector displayed a repellent rate of approximately 20%. Conversely, tobacco leaves expressing LaTPS7 attracted ladybugs at a rate of 48.33%, while leaves coexpressing LaTPS7 and LaCYP71D582 attracted ladybugs at a slightly higher rate of 58.33%. Subsequent authentic standard tests confirmed that limonene and carveol repel Myzus persicae while attracting Harmonia axyridis. The promoter activity of LaTPS7 and LaCYP71D582 was evaluated in Arabidopsis thaliana using GUS staining, and it was observed that wounding stimulated the expression of LaTPS7. The volatile compounds produced by LaTPS7, LaTPS8, and LaCYP71D582 play a crucial role in plant defence mechanisms. In practical applications, employing biological control measures based on plant-based approaches can promote human and environmental health.