The large-scale structure of the Universe formed from initially small perturbations in the cosmic density field, leading to galaxy clusters with up to 10^15 Msun at the present day. Here, we review the formation of structures in the Universe, considering the first primordial galaxies and the most massive galaxy clusters as extreme cases of structure formation where fundamental processes such as gravity, turbulence, cooling and feedback are particularly relevant. The first non-linear objects in the Universe formed in dark matter halos with 10^5-10^8 Msun at redshifts 10-30, leading to the first stars and massive black holes. At later stages, larger scales became non-linear, leading to the formation of galaxy clusters, the most massive objects in the Universe. We describe here their formation via gravitational processes, including the self-similar scaling relations, as well as the observed deviations from such self-similarity and the related non-gravitational physics (cooling, stellar feedback, AGN). While on intermediate cluster scales the self-similar model is in good agreement with the observations, deviations from such self-similarity are apparent in the core regions, where numerical simulations do not reproduce the current observational results. The latter indicates that the interaction of different feedback processes may not be correctly accounted for in current simulations. Both in the most massive clusters of galaxies as well as during the formation of the first objects in the Universe, turbulent structures and shock waves appear to be common, suggesting them to be ubiquitous in the non-linear regime.