Both PanSTARRS and ISON are thought to come from the Oort Cloud, a mass of icy bodies orbiting the sun from up to 93 trillion miles (150 trillion km) away.
A comet gets expelled from the cloud and finds a new orbit that brings it closer to the inner solar system.