Movement and exchange of organic and inorganic materials through the production and decomposition of living matter.