Many mite species live in and on dead plants – they are important decomposers. They also feed on fungi hyphae. Thus, the mites utilize the nutrients that exists in plants and fungi. Other animals then eat the mite, and their droppings become essential fertilizers for new plants.
This is an example of nature´s important recycling of nutrients. Simplified: predators eat herbivores, herbivores feed on plants, and plants take up nutrients from the ground.
Where do the nutrients come from? Most of it comes from dead plants and animals, which decomposers have broken down. Also you and I are part of this vast, complex cycling and recycling of matter.