In the present work, a numerical investigation on the mechanism of heat transfer enhancement by a cavitation bubble collapsing near a heated wall has been presented. The Navier–Stokes equations and volume of fluid (VOF) model are employed to predict the flow state and capture the liquid-gas interface. The model was validated by comparing with the experimental data. The results show that the microjet violently impinges on the heated wall after the bubble collapses completely. In the meantime, the thickness of the thermal boundary layer and the wall temperature decrease significantly within the active scope of the microjet. The fresh low-temperature liquid and the impingement brought by the microjet should be responsible for the heat transfer reinforcement between the heated wall and the liquid. In addition, it is found that the impingement width of the microjet on the heated wall always keeps 20% of the bubble diameter. And, the enhancement degree of heat transfer significantly depends on such factors as stand-off distance, saturated vapor pressure, and initial bubble radius.