This chapter argues that boredom provides an evolutionary solution to minimizing prediction error by incentivizing learning. While reducing prediction error is crucial for cognitive processes, the potential solution of isolating oneself in extremely predictable environments raises the “Dark Room Problem.” Boredom evolved to prevent this problem, making it affectively undesirable by signaling a lack of successful attentional engagement in a valued goal-congruent activity. This aversive state motivates individuals to re-engage in meaningful activities and reallocate attentional resources. The chapter reviews behavioral science and computational modeling evidence supporting boredom’s role in maximizing learning and reducing prediction error. Additionally, the authors propose that boredom's functions extend beyond modern humans to various species, presenting evidence of boredom-like states in nonhuman animals (e.g., stereotyped behavior). This chapter emphasizes the adaptive value of boredom, addressing its origins and prevalence across human and nonhuman contexts, and discusses the relationship between boredom and technology in modern society.