  The contribution of stars in galaxies to cosmic reionisation depends on the
star formation history in the Universe, the abundance of galaxies during
reionisation, the escape fraction of ionising photons and the clumping factor
of the inter-galactic medium (IGM). We compute the star formation rate and
clumping factor during reionisation in a cosmological volume using a
high-resolution hydrodynamical simulation. We post-process the output with
detailed radiative transfer simulations to compute the escape fraction of
ionising photons. Together, this gives us the opportunity to assess the
contribution of galaxies to reionisation self-consistently. The strong mass and
redshift dependence of the escape fraction indicates that reionisation occurred
between z=15 and z=10 and was mainly driven by proto-galaxies forming in
dark-matter haloes with masses between 1e7 and 1e8 solar mass. More massive
galaxies that are rare at these redshifts and have significantly lower escape
fractions contribute less photons to the reionisation process than the
more-abundant low-mass galaxies. Star formation in the low-mass haloes is
suppressed by radiative feedback from reionisation, therefore these
proto-galaxies only contribute when the part of the Universe they live in is
still neutral. After z~10, massive galaxies become more abundant and provide
most of the ionising photons. In addition, we find that Population (Pop) III
stars are too short-lived and not frequent enough to have a major contribution
to reionisation. Although the stellar component of the proto-galaxies that
produce the bulk of ionising photons during reionisation is too faint to be
detected by the James Webb Space Telescope (JWST), these sources are brightest
in the H-alpha and Ly-alpha recombination lines, which will likely be detected
by JWST in deep surveys.
