The evolutionary scaling of brain size on body size among species is strikingly constant across vertebrates, suggesting that the brain size is constrained by body size. Body size is a strong predictor of brain size, but the size variation in brain size independent of body size remains to be explained. Several hypotheses have been proposed, including the social-brain hypothesis which states that a large brain is an adaptation to living in a group with numerous and complex social interactions. In this thesis I investigate the allometric scaling of brain size and neocortex size and test several adaptive hypotheses in Artiodactyla (even-toed ungulates), using a phylogenetic comparative method where the trait is modeled as an Ornstein-Uhlenbeck process. I fit models of brain size and neocortex size, absolute and relative, in response to diet, habitat, gregariousness, gestation length, breeding group size, sexual dimorphism, and metabolic rate. Most of the investigated variables have no effect on the relative size of brain and neocortex, but the optimal relative size of the brain and neocortex is 20% and 30% larger, respectively, in gregarious species than in solitary species. Once allometric scaling and adaptation is taken into account, the phylogenetic half-lives of brain size and neocortex size are small on evolutionary timescales. In other words, there seems to be not much, if any phylogenetic inertia constraining the evolution of brain size and neocortex size. In the first appendix, I present the summary of revisions for a new and improved version of the software SLOUCH (Stochastic Linear Ornstein-Uhlenbeck Comparative Hypotheses) that was used to fit the phylogenetic comparative models.