Is there any theory that explains how water ecosystem function toward improving water quality, water purification (water self-purification)?

Is there any theory that explains how water ecosystem function toward improving water quality, water purification (water self-purification)?

https://5bio5.blogspot.com/2017/07/is-there-any-theory-that-explains-how.html

There are many factors and processes that are relevant to  water ecosystem function toward improving water quality, water purification (water self-purification). Some theory is needed to explain how these factors and processes interact and function together.

Keywords: aquatic ecosystem, water quality, water self-purification, theory, ecosystem function,