Trees are green because the cells that make up the leaves contain little packets (called chloroplasts) of the pigment chlorophyll. This pigment absorbs red and blue light, but reflects green light. Trees and plants use chlorophyll to absorb energy from sunlight and transform it into energy. When we eat plants we are getting energy that originally came from the sun, and the same is true if we eat animals that eat plants or animals.
All kidding aside, we seriously need to figure out how this works so we can harness it.