The mechanism of generation of shock waves by the collapse of a cavitation bubble near a single particle or dual particles is numerically investigated using OpenFOAM. For the single-particle case, shock waves during bubble inception and jet impacting on the particle surface are revealed in detail. The pressure induced on the particle by the inception shock wave of the bubble decreases with increasing bubble-particle distance, and the pressure is proportional to 1/r1.26 (r being the distance from the center of the shock wave). For the dual particles, the evolution of the neck structure is closely related to the generation mechanism of the shock wave. At extremely close particle–bubble distances, two shock waves propagating in opposite directions are emitted outside and inside the bubble after two necks collide. At long particle–bubble distances, a shock wave is emitted after the neck contracts, and simultaneously the bubble splits into two daughter bubbles. The energy of the shock wave generated by the neck constriction (i.e., the pressure at its generation location) first increases and then decreases with increasing bubble-particle distance. For unequal-sized double particles, the size of the daughter bubble depends on the bubble-particle distance and the particle size. These findings provide new perspectives for understanding the damage sustained by hydro-mechanical components operating in sand-laden water flows.