Black holes and cosmic jets join forces to shape galaxies