Statistical Physics Approach to the Impermanence and Robustness of Ecosystems