The origin and dissolution of comets