Based on resource allocation theory, a negative correlation is predicted between resource availability and plant defense against herbivore attack. Plants growing in resource-limited environments should display lower growth and higher defense against herbivores than plants growing where resources are less limited. Interspecific comparisons generally support these predictions. We evaluated this hypothesis at the intraspecific level, for two sapling populations of the canopy tree Dialium guianense (Caesalpiniaceae) at the Lacandona rain forest in southeast Mexico. The two populations occur in nearby sites, adjacent to the Chajul Field Station, under the same climatic conditions and within the same vegetation type, but with considerable differences in soil quality. The Floodplain site, under the influence of the Lacantun River, has favorable conditions for plant growth, in terms of nutrient and water availability, whereas the Hills site, given its location and soil characteristics, provides more restricted conditions for plant growth. Plants in the Floodplain site had higher growth and lower concentration of phenolic compounds than plants in the Hills (a two-fold difference in leaf area production, 1.3 less total phenolics). These differences were correlated with differences in herbivore attack, as saplings from the Hills, with a higher defensive potential, had lower average levels of herbivory than Floodplain plants (3.86% ± 0.80 vs. 7.75% ± 1.43 of leaf area loss). The relationship between the concentration of phenolic compounds and leaf quality for herbivores was consistent with preference assays carried out under laboratory conditions using two species of generalist herbivores, the army worm Spodoptera fugiperda and the native katydid Orophus sp. In 63.8 and 81.3% of the cases, third-instar larvae of S. fugiperda and adults of Orophus, respectively, preferred leaflets from the Floodplain plants population. Moreover, on average, the adults of Orophus consumed 2.9 times more leaf area from the Floodplain than from the Hills. In addition, a reciprocal transplant experiment indicated that phenotypic plasticity is likely to be the mechanism by which the plants expressed differential growth and traits affecting herbivory levels. In this experiment, growth and herbivory levels were 1.6 and 1.7 times higher, respectively, in plants transplanted into a Floodplain experimental plot than those in a Hills plot. This work contributes to our understanding of how edaphic heterogeneity can determine intraspecific variation in the relationship of plants with their herbivores and evaluates the underlying mechanisms promoting such influence.