Ecosystems become more resilient to environmental change through "portfolio effects" operating across multiple levels of ecological organization.