The minerals and nutrients that plants need like magnesium and nitrates are at a higher concentration inside the cell than they are outside in the soil, and they cannot absorb them by diffusion, instead they have to use energy to absorb them by active transport against their concentration gradient, with the energy coming from cellular respiration which happens in mitochondria.