Numerical investigation of the compressible flow past a wavy cylinder was carried out using large-eddy simulation for a free-stream Mach number M∞ = 0.75 and a Reynolds number based on the mean diameter Re = 2 × 105. The flow past a corresponding circular cylinder was also calculated for comparison and validation against experimental data. Various fundamental mechanisms dictating the intricate flow phenomena, including drag reduction and fluctuating force suppression, shock and shocklet elimination, and three-dimensional separation and separated shear-layer instability, have been studied systematically. Because of the passive control of the flow over a wavy cylinder, the mean drag coefficient of the wavy cylinder is less than that of the circular cylinder with a drag reduction up to 26%, and the fluctuating force coefficients are significantly suppressed to be nearly zero. The vortical structures near the base region of the wavy cylinder are much less vigorous than those of the circular cylinder. The three-dimensional shear-layer shed from the wavy cylinder is more stable than that from the circular cylinder. The vortex roll up of the shear layer from the wavy cylinder is delayed to a further downstream location, leading to a higher-base-pressure distribution. The spanwise pressure gradient and the baroclinic effect play an important role in generating an oblique vortical perturbation at the separated shear layer, which may moderate the increase of the fluctuations at the shear layer and reduce the growth rate of the shear layer. The analysis of the convective Mach number indicates that the instability processes in the shear-layer evolution are derived from oblique modes and bi-dimensional instability modes and their competition. The two-layer structures of the shear layer are captured using the instantaneous Lamb vector divergence, and the underlying dynamical processes associated with the drag reduction are clarified. Moreover, some phenomena relevant to the compressible effect, such as shock waves, shocklets and shock/turbulence interaction, are analysed. It is found that the shocks and shocklets which exist in the circular cylinder flow are eliminated for the wavy cylinder flow and the wavy surface provides an effective way of shock control. As the shock/turbulence interaction is avoided, a significant drop of the turbulent fluctuations around the wavy cylinder occurs. The results obtained in this study provide physical insight into the understanding of the mechanisms relevant to the passive control of the compressible flow past a wavy surface.