The formation of nanoparticles within the laser-induced cavitation bubble is studied in situ using small angle X-ray scattering with high spatiotemporal resolution. Directly after laser ablation, two different particle fractions consisting of compact primary particles of 8-10 nm size and agglomerates of 40-60 nm size are formed. The abundance of these species is strongly influenced by the dynamics of the oscillating cavitation bubble. Primary particle mass is most abundant during maximal expansion of the first bubble and reappears a little weaker in the rebound. In contrast to this, the mass abundance of agglomerates is relatively low in the first bubble but strongly increases during first bubble collapse and following rebound. Although most of the ablated material is trapped inside the bubble and follows its oscillation, a minor fraction of both species could be detected outside the cavitation bubble even before its final collapse.