Connectivity and Stability in Ecological and Energy Systems