Large surveys using the Sunyaev–Zel’dovich (SZ) effect to find clusters of galaxies are now starting to yield large numbers of systems out to high redshift, many of which are new discoveries. In order to provide theoretical interpretation for the release of the full SZ cluster samples over the next few years, we have exploited the large-volume Millennium gas cosmological N-body hydrodynamics simulations to study the SZ cluster population at low and high redshift, for three models with varying gas physics. We confirm previous results using smaller samples that the intrinsic (spherical) Y500–M500 relation has very little scatter (), is insensitive to cluster gas physics and evolves to redshift 1 in accordance with self-similar expectations. Our preheating and feedback models predict scaling relations that are in excellent agreement with the recent analysis from combined Planck and XMM–Newton data by the Planck Collaboration. This agreement is largely preserved when r500 and M500 are derived using the hydrostatic mass proxy, YX, 500, albeit with significantly reduced scatter (), a result that is due to the tight correlation between Y500 and YX, 500. Interestingly, this assumption also hides any bias in the relation due to dynamical activity. We also assess the importance of projection effects from large-scale structure along the line of sight, by extracting cluster Y500 values from 50 simulated 5 × 5-deg2 sky maps. Once the (model-dependent) mean signal is subtracted from the maps we find that the integrated SZ signal is unbiased with respect to the underlying clusters, although the scatter in the (cylindrical) Y500–M500 relation increases in the preheating case, where a significant amount of energy was injected into the intergalactic medium at high redshift. Finally, we study the hot gas pressure profiles to investigate the origin of the SZ signal and find that the largest contribution comes from radii close to r500 in all cases. The profiles themselves are well described by generalized Navarro, Frenk & White profiles but there is significant cluster-to-cluster scatter. In conclusion, our results support the notion that Y500 is a robust mass proxy for use in cosmological analyses with clusters.