describe how matter cycles through an ecosystem