Even after the major planets in our Solar System
had already formed, these planetesimals -- thousands
or millions of them -- still roamed around the Solar System.
Many of them ultimately collided with the major planets.
http://www.psrd.hawaii.edu/Jan01/lunarCataclysm.html
This last rush of relatively large collisions is known as
the Late Heavy Bombardment or the
Lunar Cataclysm. It ended around 3.9 billion
years ago.