plants gain energy from sunlight through photosynthesis