It’s more than just that too. Certain types of trees form forests near beaches and effectively act to pull water inland for other species of trees and plants. A lot of the things that need to be done (clean, maybe even desalinate?, water and carbon sequestration) may be done with trees.
It's easy to forget how old some genuses of trees are and that in some cases they did all of this many times before across many epochs of this planet. It is interesting to wonder what would happen if we just planted a lot more trees. Replaced some of our asphalted parking lots and flattened single crop agriculture fields back with forests.
Plants did all of these, but they did the minimal amount necessary for them to survive. We can use existing plants as a huge library to mix and match behavior to get what we need. Unfortunately "just replacing" won't produce a very good results, as in many places normal forests won't survive, and in many other places they won't produce enough food compared ti single crop fields. But with gene engineering we can change that.