Understanding diversity–stability relationships: towards a unified model of portfolio effects