This paper describes numerically the rapid deflagration-to-detonation transition (DDT) in detail in a high-frequency pulse detonation rocket engine. Different from traditional DDT, reactants are injected into the chamber from near the open end and travel toward the closed end. Previous experiments have implied that the gasdynamic shock by injecting in a confined space and the intensive turbulence generated by the high-speed jet play important roles in the detonation initiation, but explanations of how, when, and where the detonation is generated were not presented clearly due to the limitation of experimental observation. In this work, high-resolution two-dimensional simulations are performed to investigate this process employing a physical model similar to the experimental configuration. A new mechanism manifesting itself as a complicated vortex–flame interaction is found for the flame transition from a laminar to compressible or choking regime. It is discovered that the gasdynamic shock, after reflecting from the end wall, triggers the detonation through the gradient of reactivity with the hot spot formed by the collision of the shock and the flame. A dimensionless criterion defined by the ratio of the acoustic speed to the inverse gradient of the ignition delay time is applied to further describe the spontaneous wave propagation from the perspective of chem-physical dynamics. This criterion quantitatively gives a good prediction of the propagating mode from the subsonic deflagration to a developing detonation, even in such a complex scenario as encountered in this work.