Planetesimals collided and grew larger by sticking together eventually combing to form the planets.The planetesimals were just large enough for their own gravity to start pulling in material.They would therefore grow by pulling in dust and rocks and by colliding with other planetesimals, forming growing masses of rock.