Comets are volatile bodies orbiting the Sun. When they get close to the Sun, some parts of the comet boil off, forming a 'tail', which points away from the Sun.
Comets travel in eccentric orbits. Some travel in elliptical orbits, which means they will return, some only make one pass, as they are on hyperbolic paths.
The first comet to be predicted for a return was Halley's comet, which returns in its orbit to a point reasonably near the Earth about every 76 years.
In 1950, Jan Oort suggested the presence of a cometary cloud. Now known as the Oort Cloud, orbiting the Sun, some distance beyond the orbit of Pluto.
New comets that we see entering our part of the solar system are probably ejected from the Oort Cloud, although the cause of their ejection remains unknown.
According to many astronomers, comets are probably ejected by the gravitational effects of Kuiper Belt Objects pulling them from their previous stable orbits.
Jupiter acts as a major 'comet sweeper', dragging down most of the inner comets: without Jupiter, many more comets would collide with the Earth.