The solar panels/cells take in the sun's energy by being exposed to sunlight. Afterwards, this is then used to generate electricity. Similarly, the leaves of a plant act as the solar cells or panels, and use it to absorb the energy of the sun. Along with carbon dioxide, this is used to generate oxygen.