Reproductive competition favours solitary living while ecological constraints impose group-living in African striped mice.