Photosynthesis produces carbohydrates, but plants also need proteins, lipids, and nucleic acids.
Since plants don't eat, they must make these substances themselves.
Carbohydrates contain carbon, hydrogen, and oxygen, but proteins also require nitrogen, among other elements.
Other plant chemicals, like chlorophyll, require elements such as magnesium and nitrogen.
Without these elements, plants can't photosynthesize or grow properly.
Plants absorb these essential elements as mineral ions from the soil through root hair cells.