Jupiter is a gas giant, with a mass approximately 317.8 times that of Earth, and its atmosphere has a composition that's typical of gas in space: almost 75% hydrogen and almost 24% helium, (barely different to the primordial gas created by the Big Bang). However, its interior also contains rock and metal components.
Until quite recently it was thought that Jupiter's rocky & metallic core was fairly small and compact. Various models gave estimates of a core mass ranging from 7 to 18 Earth masses. But gravitational data from the Juno mission has changed the picture rather radically. It seems that Jupiter's core is diffuse rather than compact, extending fuzzily to almost half the planet's radius! At present, we aren't quite sure of how such a core was formed, but the leading hypothesis is that Jupiter's primordial core was shattered by an extreme impact event.
From Nature, DOI: 10.1038/s41586-019-1470-2 The formation of Jupiter’s diluted core by a giant impact by Shang-Fei Liu, Yasunori Hori, Andrea Isella:
The Juno mission has provided an accurate determination of Jupiter’s
gravitational field, which has been used to obtain information about
the planet’s composition and internal structure. Several models of
Jupiter’s structure that fit the probe’s data suggest that the planet
has a diluted core, with a total heavy-element mass ranging from ten
to a few tens of Earth masses (about 5 to 15 per cent of the Jovian
mass), and that heavy elements (elements other than hydrogen and
helium) are distributed within a region extending to nearly half of
Planet-formation models indicate that most heavy elements are accreted
during the early stages of a planet's formation to create a
relatively compact core and that almost no solids are accreted
during subsequent runaway gas accretion. Jupiter’s diluted core,
combined with its possible high heavy-element enrichment, thus
challenges standard planet-formation theory.
A possible explanation is erosion of the initially compact
heavy-element core, but the efficiency of such erosion is uncertain
and depends on both the immiscibility of heavy materials in metallic
hydrogen and on convective mixing as the planet evolves. Another
mechanism that can explain this structure is planetesimal enrichment
and vaporization during the formation process, although relevant
models typically cannot produce an extended diluted core.
Here we show that a sufficiently energetic head-on collision (giant
impact) between a large planetary embryo and the proto-Jupiter could
have shattered its primordial compact core and mixed the heavy
elements with the inner envelope. Models of such a scenario lead to an
internal structure that is consistent with a diluted core, persisting
over billions of years.
We suggest that collisions were common in the young Solar system and
that a similar event may have also occurred for Saturn, contributing
to the structural differences between Jupiter and Saturn.
In contrast, the total current mass of the asteroid belt is roughly 4% that of our Moon, so just under 0.05% of the mass of the Earth. Undoubtedly, Jupiter has swallowed numerous asteroids and comets over its lifetime, but even if it ate all of the asteroids in the asteroid belt that would only amount to less than 1% of its total rock and metal content, compared to the primordial rock and metal that it has had since its formation, including whatever rock & metal it inherited from the core impactor hypothesized by Liu et al.