The ultimate source of energy for these transfers is the sun, whose energy can be used both directly and indirectly.
Most of the energy used by living things comes either directly or indirectly from the sun.