The turbulent boundary layer approaching a wall-mounted obstacle experiences a strong adverse pressure gradient and undergoes three-dimensional separation leading to the formation of a dynamically rich horseshoe vortex (HSV) system. In a pioneering experimental study, Devenport and Simpson [J. Fluid Mech. 210, 23 (1990)] showed that the HSV system forming at the leading edge region of a wing mounted on a flat plate at Re=1.15 × 105 exhibits bimodal, low-frequency oscillations, which away from the wall produce turbulent energy and stresses one order of magnitude higher than those produced by the conventional shear mechanism in the approaching turbulent boundary layer. We carry out numerical simulations for the experimental configuration of Devenport and Simpson using the detached-eddy-simulation (DES) approach. The DES length scale is adjusted for this flow to alleviate the well known shortcoming of DES; namely that of premature, laminar-like flow separation. The numerical simulations reproduce with good accuracy most experimental observations, including both the distributions of the mean flow and turbulence quantities and the bimodal dynamics of the velocity field in the HSV region. The only remaining discrepancy between experiments and simulations is the predicted location of the HSV, which is somewhat further upstream from the wing than the measured one. Proper orthogonal decomposition (POD) of the resolved flow field is employed to gain insights into the coherent dynamics of the flow. The POD analysis shows that 85% of the energy in the vortex region is accounted for by the first two POD modes whose dynamics is quasiperiodic. To elucidate the physical mechanisms that lead to the onset of the bimodal dynamics, we employ probability-density-function-based conditional averaging and visualization of the instantaneous three-dimensional structure of the HSV using the q criterion. We show that the bimodal dynamics is due to the continuous and aperiodic interplay of two basic states: an organized state with a coherent necklace-like HSV, and a disorganized state with hairpin vortices wrapping around the HSV. We argue that the emergence of hairpin vortices is the result of centrifugal instability.