What is the role of photosynthesis in plants?