We discuss the central role played by the X-ray study of hot baryons within galaxy clusters to reconstruct the assembly of cosmic structures and to trace the past history of star formation and accretion onto supermassive Black Holes (BHs). We shortly review the progress in this field contributed by the current generation of X-ray telescopes. Then, we focus on the outstanding scientific questions that have been opened by observations carried out in the last years and that represent the legacy of Chandra and XMM: (a) When and how is entropy injected into the inter-galactic medium (IGM)? (b) What is the history of metal enrichment of the IGM? (c) What physical mechanisms determine the presence of cool cores in galaxy clusters? (d) How is the appearance of proto-clusters at z~2 related to the peak of star formation activity and BH accretion? We show that a highly efficient observational strategy to address these questions is to carry out a large-area X-ray survey, reaching a sensitivity comparable to that of deep Chandra and XMM pointings, but extending over several thousands of square degrees. A similar survey can only be carried out with a Wide-Field X-ray Telescope (WFXT), which combines a high survey speed with a sharp PSF across the entire FoV. We emphasize the important synergies that WFXT will have with a number of future ground-based and space telescopes, covering from the radio to the X-ray bands. Finally, we discuss the immense legacy value that such a mission will have for extragalactic astronomy at large.