The short answer to this question will sound like "there is a green pigment in plants - chlorophyll." But there is more
The detailed answer is related to the wavelengths andcellular components, as well as photosynthesis, through which plants produce nutrients using sunlight. Hidden inside tiny organelles called chloroplasts are chlorophyll molecules. The chlorophyll molecule consists of magnesium and four pyrrole rings connected to each other by methine bridges. The molecule absorbs certain wavelengths of visible light, primarily red and blue. Green light is not absorbed, but instead reflected directly into your eyes.
But chlorophyll is needed not only for beauty.It also plays an important role in the process of photosynthesis, by which plants convert inorganic material into usable organic matter (sugar). Chlorophyll molecules absorb light quanta and transfer energy to special molecules that, when stimulated, can emit an electron that causes chemical changes in the plant. Further processes convert the chemical energy into sugar.