‘The Holy Grail’ of plant ecology is to uncover rules that associate species and traits with environmental constraints, community composition and subsequent ecosystem functioning. These aims have been crystallized in recent years within the context of global climate change and environmental pollution, increasing the urgency of the need to predict how vegetation will respond across spatial scales. We investigated whether genetic diversity is associated with the way in which phenotypic plasticity within plant populations is realized and whether this is related to genotype abundance. We used environmental metabolomics to demonstrate biochemical variation between co-occurring genotypes of Carex caryophyllea L. A novel combined metabolomic/functional trait analysis was used to test the functionality of this variation in governing plasticity to variation in edaphic conditions, with particular reference to metabolic pathways that play important roles in growth-related traits. We show that genetic diversity within a wild C. caryophyllea population relates to differences in metabolic composition and functional traits in response to soil nutrient variation, influencing genotype abundance within a community. Our findings highlight the vital role genetic diversity plays within a population in facilitating plant phenotypic plasticity and the potential usefulness of environmental metabolomics to future ecological studies.