  Compact groups of dwarf galaxies (CGDs) have been observed at low redshifts
($z<0.1$) and are direct evidence of hierarchical assembly at low masses. To
understand the formation of CGDs and the galaxy assembly in the low-mass
regime, we search for analogues of compact (radius $\leq 100$ kpc) groups of
dwarfs ($7 \leq \log[M_{\ast}/{\rm M}_\odot] \leq 9.5$) in the IllustrisTNG
highest-resolution simulation. Our analysis shows that TNG50-1 can successfully
produce CGDs at $z=0$ with realistic total and stellar masses. We also find
that the CGD number density decreases towards the present, especially at $z
\lesssim 0.26$, reaching $n \approx 10^{-3.5}$ $\rm cMpc^{-3}$ at $z = 0$. This
prediction can be tested observationally with upcoming surveys targeting the
faint end of the galaxy population and is essential to constrain galaxy
evolution models in the dwarf regime. The majority of simulated groups at $z
\sim 0$ formed recently ($\lesssim 1.5 \ \rm Gyr$), and CGDs identified at $z
\leq 0.5$ commonly take more than 1 Gyr to merge completely, giving origin to
low- to intermediate-mass ($8 \leq \log[M_{\ast}/{\rm M}_\odot] \leq 10$)
normally star-forming galaxies at $z=0$. We find that halos hosting CGDs at $z
= 0$ formed later when compared to halos of similar mass, having lower stellar
masses and higher total gas fractions. The simulations suggest that CGDs
observed at $z \sim 0$ arise from a late hierarchical assembly in the last
$\sim 3$ Gyr, producing rapid growth in total mass relative to stellar mass and
creating dwarf groups with median halo masses of $\sim 10^{11.3}$ $\rm M_\odot$
and B-band mass-to-light ratios mostly in the range $10 \lesssim M/L \lesssim
100$, in agreement with previous theoretical and observational studies.
