  Magnetic holes are plasma structures that trap a large number of particles in
a magnetic field that is weaker than the field in its surroundings. The
unprecedented high time-resolution observations by NASA's Magnetospheric
Multi-Scale (MMS) mission enable us to study the particle dynamics in magnetic
holes in the Earth's magnetosheath in great detail. We reveal the local
generation mechanism of whistler waves by a combination of Landau-resonant and
cyclotron-resonant wave-particle interactions of electrons in response to the
large-scale evolution of a magnetic hole. As the magnetic hole converges, a
pair of counter-streaming electron beams form near the hole's center as a
consequence of the combined action of betatron and Fermi effects. The beams
trigger the generation of slightly-oblique whistler waves. Our conceptual
prediction is supported by a remarkable agreement between our observations and
numerical predictions from the Arbitrary Linear Plasma Solver (ALPS). Our study
shows that wave-particle interactions are fundamental to the evolution of
magnetic holes in space and astrophysical plasmas.
