Sunlight provides the energy that drives nearly all ecosystems although only photosynthetic organisms use it directly as an energy source.
Sunlight is the main source of energy for all of the organisms in most food chains.