The occurrence of critical high-temperature regions within explosives is a crucial factor in initiating combustion and explosion. The primary causes of hot regions in cavity-containing explosives are dissipative processes occurring inside the explosive or at its interface, such as shear, friction, viscosity, plasticity, and heat transfer. Currently, there is limited research on the generation and dissipation mechanisms of critical high-temperature regions in cavity-containing explosives during impacts, based on the mesoscale analysis that describes particle motion. In this study, a model based on the discrete element method is employed allowing for an accurate analysis of the dynamic and thermodynamic processes among particles, which systematically considers the shear history between particles, elastoplastic collisions, and heat transfer between particles. The temporal evolution of particle temperature and dissipated work contours during the impact process of explosives with different cavity shapes is analyzed. Explosives with cavities undergo three stages during the impact process: the formation of the trapezoidal high-temperature region, cavity collapse, and dispersion of the particle bed, ultimately leading to the formation of two main critical high-temperature regions: near the cavity and near the wall. The temperature rise of hot particles near the wall can be roughly divided into two stages, and the temperature rise mechanisms are different. Initially, the temperature rise is primarily attributed to plastic dissipation of hot particles, and the same initial impact velocity results in the same temperature rise. During the cavity collapsing, continuous momentum transfer occurs between the hot particles near the wall and the particles in the high-temperature shear bands, deeply influencing the development of the high-temperature shear bands through the movement of the hot particles near the cavity. Therefore, the different collapse modes of hot particles near cavities of different shapes lead to differences in the later temperature evolution of the hot particles near the wall. The unique aggregation processes of hot particles near cavities of various shapes result in distinct high-temperature region morphologies: circular cavity exhibits approximate “——” shape, triangular cavity displays arch shape, and inverted triangular cavity presents “M” shape. Significantly, a new mechanism resulting from the interaction of two opposing “jet “flows for the formation of higher-temperature hot regions near the circular cavity has been discovered.