Numerical investigation was conducted to understand the dynamic mechanism and effect of shear layer on the mixing and combustion of supersonic flow in a supersonic combustor with cavities.The complex wave structure including shock wave,expansion wave and the interaction of shock wave with shear layer could effectively and significantly increase mixing; and the mass and momentum exchanges between backflow zones in the cavities and main flow would enhance the ignition and stabilization of combustion.