Ecosystems and how they work