Leveraging the resilience of microbial communities to support stable ecosystems