Primary metabolites are essential compounds like carbohydrates, proteins, lipids and nucleic acids that are involved in fundamental processes like energy production and tissue formation in all organisms. Secondary metabolites are non-essential compounds produced by specialized metabolic pathways in only some organisms. They play roles in defense, adaptation and have pharmacological activities. Some major classes of secondary metabolites are terpenes, phenolics and nitrogen-containing compounds.