We present a detailed comparison between numerical cosmological hydrodynamic zoom simulations and the semi-analytic model (SAM) of Somerville et al., run within merger trees extracted from the simulations. The high-resolution simulations represent 48 individual haloes with virial masses in the range . They include radiative H and He cooling, photoionization, star formation and thermal supernova (SN) feedback. We compare with different SAM versions including only this complement of physical processes, and also ones including SN-driven winds, metal cooling and feedback from active galactic nuclei (AGN). Our analysis is focused on the cosmic evolution of the baryon content in galaxies and its division into various components (stars, cold gas and hot gas), as well as how those galaxies acquired their gas and stellar mass. Both the SAMs and simulations are compared with observational relations between halo mass and stellar mass, and between stellar mass and star formation rate, at low and high redshifts. We find some points of agreement and some important disagreements. SAMs that include the same physical processes as the simulations reproduce the total baryon fraction in haloes and the fraction of cold gas plus stars in the central galaxy to better than 20 per cent. However, the simulations turn out to have much higher star formation efficiencies (by about a factor of 10) than the SAMs, despite nominally being both normalized to the same empirical Kennicutt relation at z= 0. Therefore the cold gas is consumed much more rapidly in the simulations, and stars form much earlier. Also, simulations show a transition from stellar mass growth that is dominated by in situ formation of stars to growth that is predominantly through accretion of stars formed in external galaxies. In SAMs, stellar growth is always dominated by in situ star formation, because they significantly underpredict the fraction of mass growth from accreted stars relative to the simulations. In addition, SAMs overpredict the overall gas accretion rates relative to the simulations, and overestimate the fraction of ‘hot’ relative to ‘cold’ accretion. We discuss the reasons for these discrepancies, and identify several physical processes that are missing in our SAM and in other SAMs but which should be included. We also highlight physical processes that are neglected in the simulations studied here, but which appear to be crucial in order to understand the properties of real galaxies.