Dynamical friction plays an important role in planetary formation. The basic notion is equipartition of energy - not by collisions, but by gravitational interactions. When the protoplanetary disk has reached the stage of being populated by a variety of bodies of various masses, random gravitational encounters will tend to slow down the big ones and speed up the small ones - relative to the mean orbital speed. Being slower is an advantage from the standpoint of growth, as larger bodies with smaller relative velocities merge more readily, so the big get bigger faster than the small. The fast moving smaller planetesimals either get ejected or ultimately crash into bodies large enough to hang on to them.
Encounters between the large bodies, whether planets or protoplanets, and the smaller, statistically tend to change the semi-major axis of the little guys, but unless the little guys are ejected completely, they are doomed to return to the point of encounter with the big guy. Comets, which presumably formed somewhere in the not too distant solar system, get large semi-major axes in this fashion.
If that were the end of the story, all the comets would have burned up or been ejected into interstellar space aeons ago. However, once they are far from the Sun on their highly elongated orbits, perturbations from passing stars or fluctuations in the collective gravitational field of the galaxy can give them little boosts that tend to change their perihelia more than their semi-major axis. Once the perihelion gets beyond Neptune, they can coast around the Sun in their multi-million year orbits, forming the Oort comet Cloud, until some other passing star or gravitational fluctuation sends them in to put on a show.