In this paper, the cavity parameters of length-to-depth ratio, aft ramp angle, and nitrogen throttling positions are numerically studied by a Large Eddy Simulation (LES) combined with the Flamelet/Progress Variable (FPV) model, to investigate the inducing factors and formation mechanism of flame flashback. These numerical studies are validated and compared to our previous experiments. It can be observed from both the calculated and experimental flow field that the larger length-to-depth ratio, sharper aft ramp angle, and nitrogen throttling closer to the cavity strengthen the mixing of fuel wake and promote the jet penetration depth. Meanwhile, the separation of the boundary layer downstream of the cavity can be induced by the shear layer, acoustic oscillation, as well as nitrogen throttling. And the above favorable prerequisites enhance the heat release nearby, while the reverse pressure gradient causes the enlargement of the boundary layer separation in turn. Under this positive feedback, thermal choking is formed and drives the reverse propagation of the high-temperature flame. It is concluded that the downstream boundary layer separation induced by the changes of the cavity parameters is a prerequisite for the flame flashback, and the formation of the thermal choking is the main reason for the flame flashback.