Why are some countries more linguistically homogeneous than others? We posit that the international environment in which a state develops partially determines the extent of its linguistic commonality and national cohesion. Specifically, the presence of an external threat of territorial conquest or externally supported secession leads governing elites to have stronger incentives to pursue nation-building strategies to generate national cohesion, often leading to the cultivation of a common national language through mass schooling. Comparing cases with similar levels of initial linguistic heterogeneity, state capacity, and development, but in different international environments, we find that states that did not face external threats to their territorial integrity were more likely to outsource education and other tools for constructing identity to missionaries or other groups, or not to invest in assimilation at all, leading to higher ethnic heterogeneity. States developing in high threat environments were more likely to invest in nation-building strategies to homogenize their populations.