The sun provides energy for growing the the plants and the animals eat the plants. Sun provides light energy to the plants for carrying out photosynthesis and this is then converted into chemical energy. The sugars made by this process is used by the plants also and the animals that eat them.