A powerful punch by black hole jets shapes the fate of galaxies