The paper explores the origin of the bimodality in galaxy properties around a characteristic stellar mass of ~3×10¹⁰ M☉. It proposes that this bimodality arises from the thermal properties of inflowing gas and their interaction with clustering and feedback processes, all related to the dark matter halo mass. In haloes below a critical shock-heating mass (M_shock ≲ 10¹² M☉), discs are formed by cold streams, leading to efficient early star formation. In more massive haloes, gas is heated by virial shocks, and feedback from active galactic nuclei suppresses further star formation, leading to 'red-and-dead' massive spheroids. The bimodality is explained by the interplay between cold flows and shock heating, with feedback processes playing a key role. The paper also discusses the implications for the angular momentum problem and the role of shock stability in galaxy formation. The results are supported by simulations and provide insights into the observed features of galaxy evolution, including the truncation of the luminosity function and the appearance of very red bright galaxies at z ~ 1. The critical mass scale for shock heating is found to be around 10¹² M☉, with variations depending on redshift, metallicity, and gas fraction. The paper highlights the importance of understanding the interplay between gas dynamics, feedback, and dark matter halo properties in explaining the observed galaxy bimodality.The paper explores the origin of the bimodality in galaxy properties around a characteristic stellar mass of ~3×10¹⁰ M☉. It proposes that this bimodality arises from the thermal properties of inflowing gas and their interaction with clustering and feedback processes, all related to the dark matter halo mass. In haloes below a critical shock-heating mass (M_shock ≲ 10¹² M☉), discs are formed by cold streams, leading to efficient early star formation. In more massive haloes, gas is heated by virial shocks, and feedback from active galactic nuclei suppresses further star formation, leading to 'red-and-dead' massive spheroids. The bimodality is explained by the interplay between cold flows and shock heating, with feedback processes playing a key role. The paper also discusses the implications for the angular momentum problem and the role of shock stability in galaxy formation. The results are supported by simulations and provide insights into the observed features of galaxy evolution, including the truncation of the luminosity function and the appearance of very red bright galaxies at z ~ 1. The critical mass scale for shock heating is found to be around 10¹² M☉, with variations depending on redshift, metallicity, and gas fraction. The paper highlights the importance of understanding the interplay between gas dynamics, feedback, and dark matter halo properties in explaining the observed galaxy bimodality.