  Upstream of shocks, the foreshock is filled with hot ions. When these ions
are concentrated and thermalized around a discontinuity, a diamagnetic cavity
bounded by compressional boundaries, referred to as a foreshock transient,
forms. Sometimes, the upstream compressional boundary can further steepen into
a secondary shock, which has been observed to accelerate particles and
contribute to the primary shock acceleration. However, secondary shock
formation conditions and processes are not fully understood. Using
particle-in-cell simulations, we reveal how secondary shocks are formed. From
1D simulations, we show that electric fields play a critical role in shaping
the shock's magnetic field structure, as well as in coupling the energy of hot
ions to that of the shock. We demonstrate that larger thermal speed and
concentration ratio of hot ions favors the formation of a secondary shock. From
a more realistic 2D simulation, we examine how a discontinuity interacts with
foreshock ions leading to the formation of a foreshock transient and a
secondary shock. Our results imply that secondary shocks are more likely to
occur at primary shocks with higher Mach number. With the secondary shock's
previously proven ability to accelerate particles in cooperation with a
planetary bow shock, it is even more appealing to consider them in particle
acceleration of high Mach number astrophysical shocks.
