Some interesting reading about the science behind it all - https://courses.lumenlearning.com/boundless-biology/chapter/nutritional-adaptations-of-plants/
Plants cannot extract the necessary nitrogen from soil, so they form symbiotic relationships with rhizobia that can fix it as ammonia.
Nitrogen is an important macronutrient because it is part of nucleic acids and proteins. Atmospheric nitrogen, which is the diatomic molecule N2, or dinitrogen, is the largest pool of nitrogen in terrestrial ecosystems. However, plants cannot take advantage of this nitrogen because they do not have the necessary enzymes to convert it into biologically useful forms. However, nitrogen can be “fixed.” It can be converted to ammonia (NH3) through biological, physical, or chemical processes. Biological nitrogen fixation (BNF), the conversion of atmospheric nitrogen (N2) into ammonia (NH3), is exclusively carried out by prokaryotes, such as soil bacteria or cyanobacteria. Biological processes contribute 65 percent of the nitrogen used in agriculture.
The most important source of BNF is the symbiotic interaction between soil bacteria and legume plants, including many crops important to humans. The NH3 resulting from fixation can be transported into plant tissue and incorporated into amino acids, which are then made into plant proteins. Some legume seeds, such as soybeans and peanuts, contain high levels of protein and are among the most important agricultural sources of protein in the world.
Soil bacteria, collectively called rhizobia, symbiotically interact with legume roots to form specialized structures called nodules in which nitrogen fixation takes place. This process entails the reduction of atmospheric nitrogen to ammonia by means of the enzyme nitrogenase. Therefore, using rhizobia is a natural and environmentally-friendly way to fertilize plants as opposed to chemical fertilization that uses a non-renewable resource, such as natural gas. Through symbiotic nitrogen fixation, the plant benefits from using an endless source of nitrogen from the atmosphere. The process simultaneously contributes to soil fertility because the plant root system leaves behind some of the biologically-available nitrogen. As in any symbiosis, both organisms benefit from the interaction: the plant obtains ammonia and bacteria obtain carbon compounds generated through photosynthesis, as well as a protected niche in which to grow.
Many plants form associations called mycorrhizae with fungi that give them access to nutrients in the soil, protecting against disease and toxicities.
A nutrient depletion zone can develop when there is rapid soil solution uptake, low nutrient concentration, low diffusion rate, or low soil moisture. These conditions are very common; therefore, most plants rely on fungi to facilitate the uptake of minerals from the soil. Mycorrhizae, known as root fungi, form symbiotic associations with plant roots. In these associations, the fungi are actually integrated into the physical structure of the root. The fungi colonize the living root tissue during active plant growth.
Through mycorrhization, the plant obtains phosphate and other minerals, such as zinc and copper, from the soil. The fungus obtains nutrients, such as sugars, from the plant root. Mycorrhizae help increase the surface area of the plant root system because hyphae, which are narrow, can spread beyond the nutrient depletion zone. Hyphae are long extensions of the fungus, which can grow into small soil pores that allow access to phosphorus otherwise unavailable to the plant. The beneficial effect on the plant is best observed in poor soils. The benefit to fungi is that they can obtain up to 20 percent of the total carbon accessed by plants. Mycorrhizae function as a physical barrier to pathogens. They also provides an induction of generalized host defense mechanisms, which sometimes involves the production of antibiotic compounds by the fungi. Fungi have also been found to have a protective role for plants rooted in soils with high metal concentrations, such as acidic and contaminated soils.
There are two types of mycorrhizae: ectomycorrhizae and endomycorrhizae. Ectomycorrhizae form an extensive dense sheath around the roots, called a mantle. Hyphae from the fungi extend from the mantle into the soil, which increases the surface area for water and mineral absorption. This type of mycorrhizae is found in forest trees, especially conifers, birches, and oaks. Endomycorrhizae, also called arbuscular mycorrhizae, do not form a dense sheath over the root. Instead, the fungal mycelium is embedded within the root tissue. Endomycorrhizae are found in the roots of more than 80 percent of terrestrial plants.
Many species of plants are unable to make their food via photosynthesis and must acquire nutrients in a variety of additional ways.
Some plants cannot produce their own food and must obtain their nutrition from outside sources. This may occur with plants that are parasitic or saprophytic: ingesting and utilizing dead matter as a food source. In other cases, plants may be mutualistic symbionts, epiphytes, or insectivorous.
A parasitic plant depends on its host for survival. Some parasitic plants have no leaves. An example of this is the dodder, which has a weak, cylindrical stem that coils around the host and forms suckers. From these suckers, cells invade the host stem and grow to connect with the vascular bundles of the host. The parasitic plant obtains water and nutrients through these connections. The plant is a total parasite (a holoparasite) because it is completely dependent on its host. Other parasitic plants, called hemiparasites, are fully photosynthetic and only use the host for water and minerals. There are about 4,100 species of parasitic plants.
A saprophyte is a plant that does not have chlorophyll, obtaining its food from dead matter, similar to bacteria and fungi. (Note that fungi are often called saprophytes, which is incorrect, because fungi are not plants). Plants such as these use enzymes to convert organic food materials into simpler forms from which they can absorb nutrients. Most saprophytes do not directly digest dead matter. Instead, they parasitize mycorrhizae or other fungi that digest dead matter, ultimately obtaining photosynthate from a fungus that derived photosynthate from its host. Saprophytic plants are uncommon with only a few, described species.
A symbiont is a plant in a symbiotic relationship with other organisms, such as mycorrhizae (with fungi) or nodule formation. Root nodules occur on plant roots (primarily Fabaceae) that associate with symbiotic, nitrogen-fixing bacteria. Under nitrogen-limiting conditions, capable plants form a symbiotic relationship with a host-specific strain of bacteria known as rhizobia. Within legume nodules, nitrogen gas from the atmosphere is converted into ammonia, which is then assimilated into amino acids (the building blocks of proteins), nucleotides (the building blocks of DNA and RNA, as well as the important energy molecule ATP), and other cellular constituents such as vitamins, flavones, and hormones.
Fungi also form symbiotic associations with cyanobacteria and green algae; the resulting symbiotic organism is called a lichen. Lichens can sometimes be seen as colorful growths on the surface of rocks and trees. The algal partner (phyco- or photobiont) makes food autotrophically, some of which it shares with the fungus; the fungal partner (mycobiont) absorbs water and minerals from the environment, which are made available to the green alga. If one partner was separated from the other, they would both die.
An epiphyte is a plant that grows on other plants, but is not dependent upon the other plant for nutrition; it is non-parasitic. The epiphyte derives its moisture and nutrients from the air, rain, and sometimes from debris accumulating around it instead of from the structure to which it is fastened. Epiphytes have two types of roots: clinging aerial roots (which absorb nutrients from humus that accumulates in the crevices of trees) and aerial roots (which absorb moisture from the atmosphere).
An insectivorous plant has specialized leaves to attract and digest insects. The Venus flytrap is popularly known for its insectivorous mode of nutrition and has leaves that work as traps. The minerals it obtains from prey compensate for those lacking in the boggy (low pH) soil of its native North Carolina coastal plains. There are three sensitive hairs in the center of each half of each leaf. The edges of each leaf are covered with long spines. Nectar secreted by the plant attracts flies to the leaf. When a fly touches the sensory hairs, the leaf immediately closes. Fluids and enzymes then break down the prey and minerals are absorbed by the leaf. Since this plant is popular in the horticultural trade, it is threatened in its original habitat.