Why do people experience unpleasant, aversive emotions? Boredom is associated with a wide range of mental and physical health problems, including binge eating, substance use, anxiety, and depression. Nor does boredom feel good; many people are willing to shock themselves or even view upsetting images rather than be bored. Given such evidence, is it possible that boredom has adaptive value? We argue that it does; boredom provides an important evolutionary solution to minimizing prediction error by incentivizing learning. Reducing prediction error, it has been argued, is a core organizing principle underlying cognition; however, one way to reduce error is to isolate one’s self in extremely predictable environments (i.e., the “Dark Room Problem”). We argue that boredom evolved, at least in part, to prevent this. Specifically, boredom makes such a solution affectively undesirable, by aversively signaling a lack of successful attentional engagement in a valued goal-congruent activity. To reduce this aversive state, people are motivated to re-engage in meaningful activities and reallocate attentional resources. We review evidence from behavioral science and computational modeling supporting the role of boredom in maximizing learning and reducing prediction error. Furthermore, we suggest that these functions of boredom are not only present in modern humans, but have been conserved across species. We review evidence for boredom-like states in non-human animals and argue that animals likely experience boredom due to sharing many of the same psychological and physiological components of emotion as humans. For instance, animals in under-stimulated environments, such as cages or zoos, exhibit stereotyped behavior and other responses analogous to boredom in humans, including novelty seeking and play. In doing so, we address the adaptive value of boredom and its origins and prevalence in both human and non-human animals.