How is the sun responsible for providing energy for ecosystems?