Oort cloud comets orbit the Sun at great distances, but can then be perturbed by passing stars and the galactic tides. As they come into or leave the inner Solar System they may have their orbit changed by the planets, or alternatively be ejected from the Solar System. It is also possible they may collide with the Sun or a planet.