The processes by which essential nutrients, such as carbon, nitrogen, and phosphorus, are recycled within an ecosystem.