Ejective and preventative: The IllustrisTNG black hole feedback and its effects on the thermodynamics of the gas within and around galaxies