Plants form a symbiotic relationship with microbes around the growing root tips. They seem to have a way to feed just the biology that will deliver the needed nutrients back to the plant. The broad brusg view of how this works is as follows.
Plants exude sugars out of their roots and feed the biology. The minerals necessary to build the microbes bodies are taken from the surrounding soil. For example, calcium is used for cell wall strength. The microbes die and leave chelated minerals in the soil where the roots need it. Roots take up the chelated minerals or else directly assimilate the microbes. The minerals are then moved through the plants where they are needed, as regulated by hormones.