Lactation is a ubiquitous feature of mammalian reproduction. Because lactating females can draw on their nutrient reserves for milk production, it offers mothers and their dependent young independence from fluctuations in their food supplies. However, converting food to reserves and milk is relatively inefficient at delivering nutrients to offspring. We use dynamic programming to contrast the performance of mothers that provision dependent, refuge–bound offspring optimally from their nutrient reserves with otherwise equivalent mothers that do so directly from the food they find. In this way, we demonstrate formally that the selective advantage to lactating mothers, who can provision—at a cost—without having found food recently, can be substantial with uncertain food supplies and few opportunities for future reproduction under a wide range of circumstances. Hence, it is likely that unreliability associated with the lifestyles of the small, primitive mammal–like reptiles that evolved extended maternal care, selected for fully–developed milk production and consumption, prompting the evolution of true mammals. Moreover, this work suggests that selection for coping with unreliable food access during provisioning may underlie key life–history differences between birds and mammals because the mass constraints imposed by flight restrict the level of reserves that mothers can carry and provision from.