Giant planets form in the outer solar system by rapid core accretion of icy planetesimals followed by gravitational capture of hydrogen and helium gas from the protoplanetary disk. Migration theories propose that Jupiter and Saturn initially migrated inward, then outward, dramatically reshaping the inner solar system and explaining the distribution of asteroids and comets.
You already know that the solar system is divided into distinct zones: rocky terrestrial planets in the inner system, gas and ice giants in the outer system, separated roughly by the snow line (or frost line) — the distance from the Sun beyond which water ice and other volatile compounds can condense into solid grains. This zonal architecture is not an accident; it is the key to understanding why giant planets form where they do.
Beyond the snow line, the protoplanetary disk contained far more solid material than the inner disk because water ice, methane ice, and ammonia ice all condensed into grains alongside rock and metal. This abundance of solids allowed core accretion to proceed rapidly: icy and rocky planetesimals collided and stuck together, building solid cores of roughly 10 Earth masses. Once a core reached this critical mass threshold, its gravity became strong enough to capture hydrogen and helium gas directly from the surrounding disk in a runaway process. Gas poured onto the core faster and faster as the growing planet's gravity increased, and within perhaps a few million years, a planet like Jupiter accumulated hundreds of Earth masses of gas — becoming a gas giant. This entire process had to complete before the protoplanetary disk dissipated (typically within 3-10 million years), imposing a tight deadline on giant planet formation.
The discovery of "hot Jupiters" — gas giants orbiting other stars at distances closer than Mercury orbits our Sun — forced astronomers to confront a puzzle: giant planets cannot form that close to their stars (there is not enough material, and temperatures are too high for ice to condense). The solution is planetary migration. A forming giant planet interacts gravitationally with the gas disk surrounding it, exchanging angular momentum. This interaction can cause the planet to spiral inward (Type I or Type II migration, depending on whether the planet has cleared a gap in the disk). In our solar system, the Grand Tack hypothesis proposes that Jupiter migrated inward to roughly 1.5 AU before Saturn, forming later and migrating inward as well, locked into an orbital resonance with Jupiter that reversed both planets' migration and sent them back outward.
This inward-then-outward journey had dramatic consequences for the rest of the solar system. Jupiter's inward migration would have scattered and depleted the material in the inner disk, stunting the growth of Mars (explaining why Mars is much smaller than Earth) and sculpting the asteroid belt. Its outward migration redistributed icy material, potentially delivering water to the inner planets. Saturn, Uranus, and Neptune likely underwent their own orbital rearrangements — the Nice model proposes a later instability that sent Neptune outward into the Kuiper Belt, scattering icy bodies throughout the outer solar system. The architecture of our solar system — the sizes, positions, and compositions of its planets — is thus not the calm result of orderly growth in place, but the product of a violent dynamical history shaped by giant planet formation and migration.