© 2020 The Author(s) Published by Oxford University Press on behalf of the Royal Astronomical Society. We present the escape fraction of hydrogen ionizing photons (fesc) from a sample of 34 high-resolution cosmological zoom-in simulations of galaxies at z ≥ 5 in the Feedback in Realistic Environments project, post-processed with a Monte Carlo radiative transfer code for ionizing radiation. Our sample consists of 8500 haloes in Mvir ∼108-1012, M⊙ (M* ∼104-1010, M⊙) at z = 5-12. We find the sample average fesc increases with halo mass for Mvir ∼108-109.5 M⊙, becomes nearly constant for 109.5-1011 M⊙, and decreases at ≳ 1011 M⊙. Equivalently, fesc increases with stellar mass up to M* ∼ 108 M⊙ and decreases at higher masses. Even applying single-star stellar population synthesis models, we find a moderate fesc ∼0.2 for galaxies at M* ∼ 108 M⊙. Nearly half of the escaped ionizing photons come from stars 1-3 Myr old and the rest from stars 3-10 Myr old. Binaries only have a modest effect, boosting fesc by ∼25-35 per cent and the number of escaped photons by 60-80 per cent. Most leaked ionizing photons are from vigorously star-forming regions that usually contain a feedback-driven kpc-scale superbubble surrounded by a dense shell. The shell is forming stars while accelerated, so new stars formed earlier in the shell are already inside the shell. Young stars in the bubble and near the edge of the shell can fully ionize some low-column-density paths pre-cleared by feedback, allowing a large fraction of their ionizing photons to escape. The decrease of fesc at the high-mass end is due to dust attenuation, while at the low-mass end, fesc decreases owing to inefficient star formation and hence feedback. At fixed mass, fesc tends to increase with redshift. Although the absolute fesc does not fully converge with resolution in our simulations, the mass- A nd redshift-dependence of fesc is likely robust. Our simulations produce sufficient ionizing photons for cosmic reionization.