The exact knowledge of the metabolic pathways and factors modulating the formation of active compounds in plants is a must if you attempt to ameliorate the phytochemical profile composition, both in terms of yield and homogeneity.
The study of the plant’s active compounds biogenesis is crucial in order to understand the mechanisms that allow the formation of active compounds and the interrelationship between active compounds biosynthesis and the common cellular constituents. Moreover, the study of the formation of active compounds can help understanding their physiological role and the phytogenic relationship between different plant species.
Carbohydrates, proteins, lipids, nucleic acids, coenzymes, and vitamins are among the few substances used by living organisms in order to perform vital processes. The biosynthesis and degradation of these compounds constitute the “primary metabolism”.
Primary metabolites are typically formed during the plant growth phase as a result of energy metabolism, and are deemed essential for proper plant growth. Some examples of processes of the primary metabolism are:
The anaerobic and aerobic degradation of glucose
The synthesis of nucleic acids
The synthesis of proteins
In addition to the primary metabolites, which play a role in maintaining the viability of the plant a number of compounds such as terpenes, steroids, anthocyanins, anthraquinones, phenols and polyphenols, which belong to the “secondary metabolism”, are also synthesized. 
Plants secondary metabolites are produced in significant amounts, are synthesized in a precise plant organ and can accumulate in a different part of the plant, independently from their origin. To make an example tropane alkaloids are formed in the roots but can accumulate in plant leaves.
Employing marked precursors it is possible to highlight the linkage between primary metabolites and secondary ones. In fact many intermediates derived from the primary metabolism can be used by the plants to synthesize secondary metabolites. External factors can induce the plant to accumulate intermediate compounds such as fats, proteins and polysaccharides and through enzymatic or spontaneous processes it is possible to create secondary metabolites.
So these can be formed both following normal plant processes or synthesized thanks to external stimuli activating the bio-transformation.
Primary metabolites, intermediates and secondary metabolites co-exist in plants. Nevertheless the latter ones are the more interesting from a pharmacological point of view and for this reason are called active ingredients. 
Factors influencing the content and the quality of active compounds
The amount and entity of active compounds contained in an medicinal plant can vary greatly and can also miss completely. On the other hand, primary metabolites necessary for the plant functioning are present in enough quantities to guarantee the normal functioning of plant biological structure.
Many factors influence the content of secondary metabolites in a plant such as:
Genetic or endogen traits
Growing environment (ecologic traits)
Biotic factors (herbivores, pests, etc.)
The plant collecting period
The herbal preparation and conservation
For many years the general belief was that plants belonging to the same botanical species contain the same active ingredients, and that the morphological traits are the expression of these substances.
Over time, thanks to the advancements in extraction technologies, we discovered that many plants, even if similar in morphological traits, contain and produce completely different phytochemical compounds. To make an example the plants producing eucalyptus essential oil are morphologically identical. Nevertheless the organoleptic traits of the essential oil will be completely different from plant to plant. In the same way, the Indian hemp doesn’t differentiate greatly from the European hemp, apart from the great production of resin.
For this reason, over time, many efforts have been made to select the best medicinal plant varieties among the species producing a constant amount and quality of active compounds. The amelioration of plants’ physiological and biochemical traits can be made acting at the level of their genome, thus manipulating their genetic endogenous factors.
The plant’s mass and genealogical selection, the hybridization and the plant mutations are among the techniques used today to uniform the phytochemical composition of medicinal plants.
Plants mass selection
This technique is also known as phenotypic selection and it has been widely used in horticulture. Mass selection consists in collecting the seeds from the plants having the desired appearance, creating an elite plant cultivation. Repeating this selection over the years permits constant control over plant variations and degenerations. Following this methods a mixture of pure lines is obtained. Mass selection is the simplest and least expensive of plant-breeding procedure
Also known as pure-line selection, this method permits the creation of a very large number of varieties that differ from the original strain in characteristics such as color, lack of thorns or barbs, dwarfness, and disease resistance have originated in this fashion.  From a genetically variable plant population, the selection of a particular plant individual and further progeny selection is made. When the differences from the initial population are not visible anymore, extensive measurement of active compounds content and quality are performed in order to obtain pure-lines with the desired characteristics. To make an example the genealogic selection allowed the increase of morphine content in the Papaver somniferum var. album reaching 18-20% compared to other varieties having just 10% of morphine content.
The hybridization among species with the desired trait is the dominant breeding technique in the cultivation of self-pollinating plant species. Hybridization consists in the combination of desirable plants genes creating a pure-breeding progeny superior in many aspects to the parental types. The final evaluation of promising strains involves the observation, usually in a number of years and various locations, to detect weaknesses that may not have appeared previously, the precise yield testing and the quality testing. Many plant breeders test for five years at five representative locations before releasing a new variety for commercial production.
Environmental characteristics play a crucial role in the synthesis and accumulation of active compounds in a plant. The climatic conditions can influence the plant growing stages such as vegetative period, flowering and fruit ripening. And in the same way the climate can also affect the secondary metabolites production.
It has been demonstrated that the light can influence the production of active compounds in a plant. To give a few examples, the stramonium growing in full sun contains high amounts of scopolamine, 3 to 4 times higher compared to stramonium plants grown in the shade. On the other hand, Achillea plants grown in the shade will have higher production of essential oil compared to the plants of the same genus grown in the sun. Interestingly, Digitalis purpurea plants contain more cardioactive glycosides in the afternoon compared to the night period. This to say that the relation between light and plant secondary metabolites production is strictly linked to the kind of plant.
Environmental temperature greatly influences the phytochemical composition of medicinal plants. Cold climate during the spring period can greatly reduce the accumulation of essential oil in plants such as lavender but enhance the concentration of other constituents in Matricaria chamomilla. Seeds coming from hot geographical areas can be qualitatively low compared to the ones coming from cold regions. Going from hotter to colder climates, the presence of unsaturated fatty acids increases. For this reason tropical plants contain high levels of saturated fatty acids (i.e. palm oil, cocoa butter), sub-tropical plants contain higher percentage of unsaturated fatty acids (i.e. oleic acid), plants of temperate zones contain even higher concentration of unsaturated fatty acids (i.e. linoleic acid) and the ones growing in cold areas have the complete composition of unsaturated fatty acids (i.e. linolenic acid).
In humid and rainy areas, plants can progressively lose their capacity of accumulating active compounds. This could be explained with the fact that water soluble constituents could be washed away from the epidermal tissues of plant aerial parts. A plant growing in a dry area tends to oxidize its oil components and this is due to the fact that oxidation products reduce the plant transpiration allowing a major resistance of the plant to the drought.
Soil texture, composition and pH
The soil texture and pH can greatly influence the accumulation of secondary metabolites in plants. Sandy, clayey or marshy soil can variate the accumulation of compounds such as essential oil or mucilage in the same plant species. To make an example, Mentha species growing in a sandy soil will accumulate a higher amount of essential oil compared to the ones grown in marshy soil. Moreover the soil composition can directly impact the final plant composition and for this reason cultivating the plant in a different habitat than the original one can completely change its phytochemical profile, and the medicinal plant could completely lose the ability to synthesize a specific secondary metabolite, losing the therapeutic action.
The plants can mutually influence themselves if growing in proximity. Some studies have been made on the variations of phenotypic traits and phytochemical composition due to biotic factors. To make an example, Datura stramonium plants grown close to Lupinus species have greater concentration of alkaloids (more than 20-30%) compared to isolated grown ones. On the other hand Datura stramonium grown close to Mentha species will have a reduction of alkaloids of 50-60%.
Cell culture and synthetic production of active compounds
The incubation of cell plants in vitro permits the amelioration and protection of existing plant species, the creation of completely new species and the study of biosynthetic pathways for active compounds formation.
In vitro cell cultures are nowadays used to produce secondary metabolites and also for the creation of completely new biologically active substances. Plant cell culture technology offers a reliable and powerful production platform for continuous supply of contamination‐free, phytochemically uniform biomass from herbal, aromatic, medicinal, and even from rare and threatened plant species. 
After the sterilization of the material to be incubated, this can be placed on solid or liquid substrate. The second option, due to the variety of methods used such as cell culture on liquid stationary phase, periodic immersion or permanent immersion, is particularly versatile to different experimental purposes. Independently from the kind of soil used, it is important to have an initial critical number of cells in order to permit them the proliferation. The soil composition is important also in cell culture and it must contain in appropriate concentrations of nitrogen, salts such as calcium chloride, magnesium sulfate, potassium iodide, ferrous sulfate, etc.
The optimal cell proliferation temperature is between 25 and 30 °C, and light and oxygen are necessary for the production of active compounds from plant cells in vitro. 
 Nicolas-Sebastian BOCSO and, Monica BUTNARIU. (2022). The biological role of primary and secondary plants metabolites. J. Nutrition and Food Processing. 5(3); DOI: 10.31579/2637-8914/094
 Farmacognosia. Farmaci naturali, loro preparazioni ed impiego terapeutico / Capasso, Francesco; R., De Pasquale; G., Grandolino; Mascolo, NICOLA DOMENICO C. FERDINANDO. – STAMPA. – (2000).
 Georgiev V, Slavov A, Vasileva I, Pavlov A. Plant cell culture as emerging technology for production of active cosmetic ingredients. Eng Life Sci. 2018 Jul 15;18(11):779-798. doi: 10.1002/elsc.201800066. PMID: 32624872; PMCID: PMC6999513.