The probability that an individual plant will be attacked by a herbivore depends not only on the characteristics of the individual plant, but also on the quality and abundance of its neighbours. However, plants have been reported to receive protection from herbivory both when associated with plants of higher and lower palatability (the attractant-decoy and repellent-plant hypotheses, respectively), and there are no mechanistic explanation for these different outcomes of plant spatial association. We used patch-use theory (marginal-value theorem) to predict under which circumstances we should expect plants to gain protection from herbivory due to association with other plants. The predictions were tested in two field experiments, in which voles and mountain hares utilized stands consisting of a moderately preferred species (birch) mixed with a plant species of higher palatability (rowan in the vole experiment and aspen in the hare experiment) or lower palatability (alder). In both the vole- and hare-experiment, birch was least utilized when associated with plants of lower palatability, consistent with predictions from patch-use theory. However, food utilization by hares and voles differed from that predicted by patch-use theory in one respect: food selection occurred both at the stand and the plant level and not at the stand level only, indicating simultaneous optimization at stand and plant level.