Traditional production systems have viewed animals as homogeneous ‘machines’ whose nutritional and medicinal needs must be provided in a prescribed manner. This view arose from the lack of belief in the wisdom of the body to meet its physiological needs. Is it possible for herbivores to select diets that meet their needs for nutrients and to write their own prescriptions? Our research suggests it is. Herbivores adapt to the variability of the external environment and to their changing internal needs not only by generating homeostatic physiological responses, but also by operating in the external environment. Under this view, food selection is interpreted as the quest for substances in the external environment that provide homeostatic utility to the internal environment. Most natural landscapes are diverse mixes of plant species that are literally nutrition centres and pharmacies with vast arrays of primary (nutrient) and secondary (pharmaceutical) compounds vital in the nutrition and health of plants and herbivores. Plant-derived alkaloids, terpenes, sesquiterpene lactones and phenolics can benefit herbivores by, for instance, combating internal parasites, controlling populations of fungi and bacteria, and enhancing nutrition. Regrettably, the simplification of agricultural systems to accommodate inexpensive, rapid livestock production, coupled with a view of secondary compounds as toxins, has resulted in selecting for a biochemical balance in forages favouring primary (mainly energy) and nearly eliminating secondary compounds. There is a global need to create a more sustainable agriculture, with less dependence on external finite resources, such as fossil fuels and their environmentally detrimental derivatives. Self-medication has the potential to facilitate the design of sustainable grazing systems to improve the quality of land as well as the health and welfare of animals. Understanding foraging as the dynamic quest to achieve homeostasis will lead to implementing management programs where herbivores have access not only to diverse and nutritious foods but also to arrays of medicinal plants.