Sunlight is absorbed by a plants chlorophyll (the green pigmentation of the plant) and is converted from light energy to food (chemical) energy. This produces glucose sugar which the plant uses as 'food' and this creates energy for the plant to perform tasks.