Solar Nebula = planetesimal accretion
4500 million years ago (4.5 billion yrs)
Microscopic grains --> bigger --> planets
(middle-sized things = planetesimals)
(accretion = build through collisions)
nature of solid grains depends upon temperature
over a period of about 10 - 20 million years (very small period compared to 4500 million years) build up the planets, most of their moons, and the asteroids and cometary bodies
after this, there’s a period of ‘sweeping up’ the debris left over (perhaps 1 to 5% of total mass)
and on the average, about 90% of the material is ‘swept up’ in about 100 million years
in two or three hundred million years, this would allow you to sweep up 99 to 99.9% of the debris, by five hundred million years after the start of the solar system (4000 million years ago), something of the order of 99.999% of the debris had already run into the planets and their moons, and that is the cause of cratering on the lunar highlands (terrae)
There is no obvious evidence of this on the Earth, because weathering and erosion very quickly erase most (all surface) evidence, and geological activity (continental drift and plate tectonics) less quickly erases the remaining (subsurface) evidence.
On the Moon, the lack of geological activity (in ‘recent’ times), and the lack of an atmosphere (no weathering or erosion) have allowed the ancient craters to remain fresh and obvious, in most places in the highlands. But in the maria (‘seas’), the surface has been smoothed out by some kind of geological activity.
Originally, estimates of when that activity occurred ranged from 1 to 3 billion years ago (much less than the age of the Moon); but after the Apollo project brought a half ton of Moon rocks back to the Earth, it was found that rocks from the highlands mostly dated to 4.3 - 4.4 billion years ago (bya), which is very close to the origin of the Solar System. The rocks from the maria date from 3.2 - 3.9 bya
This means that the vast majority of rocks that ran into the Moon and made the craters on the highlands (and the lowlands) did so before 3.9 bya, and the episode of bombardment in the early Solar System must have been essentially over by 4 bya, and any planetary surface which has substantial evidence of that early cratering must be 4 by old, or older.
In fact recent evidence is that the majority of the initial stage of bombardment was over well before 4 billion years ago, and the later bombardment around 4 billion years ago (sometimes referred to as the era of Heavy Bombardment) was probably caused by gravitational interactions between the major planets in the outer solar system and large objects left over from their formation that substantially changed the orbits of both the smaller bodies and the major planets (examples, the large chunk probably broken off the northern half of Mars and the Caloris Basin on Mercury)