Some of the big kinetic energy found with flow at large mach numbers becomes internal energy in the fluid because of viscosity. The increase in internal energy makes the temperature go up. Because the pressure gradient normal to the flow within a boundary layer is zero, the increase of temperature through the boundary layer causes the density to fall. This causes the boundary layer over the body of the airplane to grow. This, in turn, causes the temperature to go up.