Comets have three known reservoirs: the roughly spherical Oort Cloud (for long-period comets), the flattened Kuiper Belt (for ecliptic comets), and, surprisingly, the asteroid belt (for main-belt comets). Comets in the Oort Cloud were thought to have formed in the region of the giant planets and then placed in quasi-stable orbits at distances of thousands or tens of thousands of AU through the gravitational effects of the planets and the Galaxy. The planets were long assumed to have formed in place. However, the giant planets may have undergone two episodes of migration. The first would have taken place in the first few million years of the Solar System, during or shortly after the formation of the giant planets, when gas was still present in the protoplanetary disk around the Sun. The Grand Tack (Walsh et al. in Nature 475:206–209, 2011) models how this stage of migration could explain the low mass of Mars and deplete, then repopulate the asteroid belt, with outer-belt asteroids originating between, and outside of, the orbits of the giant planets. The second stage of migration would have occurred later (possibly hundreds of millions of years later) due to interactions with a remnant disk of planetesimals, i.e., a massive ancestor of the Kuiper Belt. Safronov (Evolution of the Protoplanetary Cloud and Formation of the Earth and the Planets, 1969) and Fernandez and Ip (Icarus 58:109–120, 1984) proposed that the giant planets would have migrated as they interacted with leftover planetesimals; Jupiter would have moved slightly inward, while Saturn and (especially) Uranus and Neptune would have moved outward from the Sun. Malhotra (Nature 365:819–821, 1993) showed that Pluto’s orbit in the 3:2 resonance with Neptune was a natural outcome if Neptune captured Pluto into resonance while it migrated outward. Building on this work, Tsiganis et al. (Nature 435:459–461, 2005) proposed the Nice model, in which the giant planets formed closer together than they are now, and underwent a dynamical instability that led to a flood of comets and asteroids throughout the Solar System (Gomes et al. in Nature 435:466–469, 2005b). In this scenario, it is somewhat a matter of luck whether an icy planetesimal ends up in the Kuiper Belt or Oort Cloud (Brasser and Morbidelli in Icarus 225:40–49, 2013), as a Trojan asteroid (Morbidelli et al. in Nature 435:462–465, 2005; Nesvorný and Vokrouhlický in Astron. J. 137:5003–5011, 2009; Nesvorný et al. in Astrophys. J. 768:45, 2013), or as a distant “irregular” satellite of a giant planet (Nesvorný et al. in Astron. J. 133:1962–1976, 2007). Comets could even have been captured into the asteroid belt (Levison et al. in Nature 460:364–366, 2009). The remarkable finding of two “inner Oort Cloud” bodies, Sedna and 2012 $\mbox{VP}_{113}$ , with perihelion distances of 76 and 81 AU, respectively (Brown et al. in Astrophys. J. 617:645–649, 2004; Trujillo and Sheppard in Nature 507:471–474, 2014), along with the discovery of other likely inner Oort Cloud bodies (Chen et al. in Astrophys. J. Lett. 775:8, 2013; Brasser and Schwamb in Mon. Not. R. Astron. Soc. 446:3788–3796, 2015), suggests that the Sun formed in a denser environment, i.e., in a star cluster (Brasser et al. in Icarus 184:59–82, 2006, 191:413–433, 2007, 217:1–19, 2012b; Kaib and Quinn in Icarus 197:221–238, 2008). The Sun may have orbited closer or further from the center of the Galaxy than it does now, with implications for the structure of the Oort Cloud (Kaib et al. in Icarus 215:491–507, 2011). We focus on the formation of cometary nuclei; the orbital properties of the cometary reservoirs; physical properties of comets; planetary migration; the formation of the Oort Cloud in various environments; the formation and evolution of the Kuiper Belt and Scattered Disk; and the populations and size distributions of the cometary reservoirs. We close with a brief discussion of cometary analogs around other stars and a summary.