A comet is a Small Solar System Body that orbits the Sun and, when close enough to the Sun, exhibits a visible coma (atmosphere) or a tail-both primarily from the effects of solar radiation upon the...
Mostly, the sun's gravity combined with the eccentricity (ellipticalness) of their orbit. The closer they get to a large mass like the sun (or a planet) the more they'll speed up.