Primitive objects like comets hold important information on the material that formed our solar system. Several comets have been visited by spacecraft and many more have been observed through Earth-and space-based telescopes. Still our understanding remains limited. Molecular abundances in comets have been shown to be similar to interstellar ices and thus indicate that common processes and conditions were involved in their formation. The samples returned by the Stardust mission to comet Wild 2 showed that the bulk refractory material was processed by high temperatures in the vicinity of the early sun. The recent Rosetta mission acquired a wealth of new data on the composition of comet 67P/Churyumov-Gerasimenko (hereafter 67P/C-G) and complemented earlier observations of other comets. The isotopic, elemental, and molecular abundances of the volatile, semivolatile, and refractory phases brought many new insights into the origin and processing of the incorporated material. The emerging picture after Rosetta is that at least part of the volatile material was formed before the solar system and that cometary nuclei agglomerated over a wide range of heliocentric distances, different from where they are found today. Deviations from bulk solar system abundances indicate that the material was not fully homogenized at the location of comet formation, despite the radial mixing implied by the Stardust results. Post-formation evolution of the material might play an important role, which further