A pigment called chlorophyll gives plants their green color. Chlorophyll is an indispensable molecule in photosynthesis, the process by which plants convert sunlight into chemical energy. Chlorophyll is green because the molecules absorb the blues and reds in the spectrum of light and reflect the greens and yellows.
The color of any substance depends on the energy levels of the atoms and molecules that comprise it, as well as the spectrum of the incoming light. If an object is blue, it is because it reflects blue light and absorbs the rest, which raises the electrons in its atoms to a higher energy level in a process called excitation.