Evolution and stability of complex microbial communities driven by trade-offs