In most countries, the public sector hires disproportionally more women than men. We document gender differences in employment, transition probabilities, hours, and wages in the public and private sector using microdata for the United States, the United Kingdom, France, and Spain. We then build a search and matching model where men and women decide if to participate and if to enter private or public sector labor markets. We calibrate our model separately to the four countries. Running counterfactual experiments, we quantify whether the selection of women into the public sector is driven by: (i) lower gender wage gaps and thus relatively higher wages for women in the public sector, (ii) possibilities of better conciliation of work and family life for public sector workers, (iii) greater job security in the public compared to the private sector, or (iv) intrinsic preferences for public sector occupations. We find that, quantitatively, womens higher public sector wage premia and their preferences for working in the public sector explain most of the selection. We calculate the monetary value of public sector job security and work-life balance premia, for both men and women, and we estimate how higher public sector wages and employment affect male and female unemployment, inactivity rates, and wages differently.