The $r$-process-enhanced (RPE) stars provide fossil records of the assembly history of the Milky Way and the nucleosynthesis of the heaviest elements. Observations by the $R$-Process Alliance (RPA) and others have confirmed that many RPE stars are associated with chemo-dynamically tagged groups, which likely came from accreted dwarf galaxies of the Milky Way (MW). However, we do not know how RPE stars are formed. Here, we present the result of a cosmological zoom-in simulation of an MW-like galaxy with $r$-process enrichment, performed with the highest resolution in both time and mass. Thanks to this advancement, unlike previous simulations, we find that most highly RPE ($r$-II; [Eu/Fe] $> +0.7$) stars are formed in low-mass dwarf galaxies that have been enriched in $r$-process elements for [Fe/H] $\ 20 pages, 15 figures, published in MNRAS