Why is photosynthesis important to ecosystems?

It is important to every ecosystems because if they didn't have photosynthesis all the tree would if died