We study the formation and the subsequent evolution of galaxy groups w
ith mass of order 2 x 10(13) M(.) in a critical universe and show the
importance of secondary infall for their dynamical evolution. From N-b
ody simulations we find that merging is effective in building at least
one massive central remnant in a few crossing times soon after the co
llapse of the central region of the group. Merging is only slightly ac
celerated if galaxies have massive halos, because the mass initially a
ssociated with the individual galaxies is soon tidally stripped. Strip
ping is particularly effective for infalling galaxies, which thus easi
ly avoid merging with the central remnants. We find that, as a rule, m
erging is effectively terminated, and the ''merging runaway'' ends whe
n infall becomes dominant. We look for compact groups in our ensemble
of simulations and compare their statistical properties with Hickson's
compact groups (HCGs). We then discuss in terms of the Press & Schech
ter formalism the statistics of such groups and their evolution in dif
ferent cosmological scenarios. Our results show that compact group for
mation is an ongoing and frequent process in a critical universe. In p
articular, our model reconciles the apparent contradiction between the
observed absence of young-looking merger remnants and the high rate o
f strong galaxy interactions expected in compact groups. In open unive
rses, instead, earlier formation of groups and suppression of secondar
y infall makes it more unlikely that compact groups survive as such un
til the present time. We conclude that the existence of dense and dyna
mically young groups of galaxies like HCGs concurs with other dynamica
l evidence pointing toward a high-density or a flat universe.