This paper investigates the relationship between trade openness and the size ofngovernments, both theoretically and empirically. We argue that openness can increase the size of governments through two channels: (1) a terms of trade externality, whereby trade lowers the domestic cost of taxation, and (2) the demand for insurance, whereby trade raises risk and public transfers. We provide a unified framework for studying and testing these two mechanisms. Our main theoretical prediction is that the relative strength of the two explanations depends on a key parameter, namely, the elasticity of substitution between domestic and foreign goods. Moreover, while the first mechanism is inefficient from the standpoint of world welfare, the second is instead optimal. In the empirical part of the paper, we provide new evidence on the positive association between openness and government size and we explore its determinants. Consistently with the terms of trade externality channel, we show that the correlation is contingent on a low elasticity of substitution between domestic and foreign goods. Our findings raise warnings that globalization may have led to inefficiently large governments.