The process by which small rocky planets such as Earth are formed through collisions and accretion of planetesimals.