Increasing biodiversity generally enhances productivity through selection and complementarity effects not only in natural, but also in agricultural, systems. However, the quest to explain why diverse cropping systems are more productive than monocultures remains a central goal in agricultural science. In a mesocosm experiment, we constructed monocultures, two- and four-species mixtures from eight crop species with or without fertilizer and both in temperate Switzerland and dry, Mediterranean Spain. We measured physical factors and plant traits and related these in structural equation models to selection and complementarity effects to explain seed yield differences between monocultures and mixtures. Increased crop diversity increased seed yield in Switzerland. This positive biodiversity effect was driven to almost the same extent by selection and complementarity effects, which increased with plant height and specific leaf area (SLA), respectively. Also, ecological processes driving seed yield increases from monocultures to mixtures differed from those responsible for seed yield increases through the diversification of mixtures from two to four species. Whereas selection effects were mainly driven by one species, complementarity effects were linked to larger leaf area per unit leaf weight. Seed yield increases due to mixture diversification were driven only by complementarity effects and were not mediated through the measured traits, suggesting that ecological processes beyond those measured in this study were responsible for positive diversity effects on yield beyond two-species mixtures. By understanding the drivers of positive biodiversity–productivity relationships, we can improve our ability to predict species combinations that enhance ecosystem functioning and can promote sustainable agricultural production.