A complicated and intriguing substance, soil is. The majority of it is composed primarily of compost, or other items that have decomposed. The earth absorbs the leaves that fall from the trees (etc.). Along with this, there are numerous types of clays (basically powdered rock), sands (basically crumbled rock), as well as other minerals and organics, byproducts of worm, fungus, and bacterium metabolism, and so on.
We lose much too much soil due to erosion and deforestation, which is a great shame (which leads to more erosion).
The different nutrients that plants "feed" from it include nitrogen, which certain plants require from the soil while others may obtain from the air. They do this by soaking up water and the dissolved minerals through their roots and into their systems.
The majority of what makes a plant a plant, just like the majority of what makes a tree a tree, comes from the air.
Plants absorb carbon dioxide from the atmosphere and waste oxygen in the process. Their cell walls are made of carbon from the carbon dioxide.
For instance, cellulose is (C6 H10 O5)n, much like the wood in your door, table, apartment, etc. The carbon dioxide that the plant "breathes" provides the six carbon atoms in the molecule.
In connection with this, trees physically "suck" carbon dioxide out of the air, which is why they help us slow down climate change. And for this reason, burning fossil fuels worsens climate change by reintroducing gases like carbon dioxide and others into the atmosphere.
Thanks,
Eddie