Planet formation, the process by which planets form, is not completely understood: theories of portions of the process seem solid, but others are not settled upon, with some unexplained. Various theories are promoted, debated and refined, but despite the questions, they are developed in detail sufficient for computer simulation as a means of showing their plausibility and generating statistics and characteristics that might be compared with observation. Theories developed before the observation of extra-solar planets naturally were developed to lead to the solar system, and exoplanets have introduced new mysteries, necessitating further development of theories. Planetary migration has come to be a major factor.
The nebular hypothesis is well accepted regarding the source of the material, the star-forming nebula settling into a circumstellar disk (a protoplanetary disk) from which the planets are formed. The two general models for the commencement of planet formation are the gravitational instability model, that the swirling disk forms volumes that reach the Jeans criterion, ultimately forming gas planets, and the core accretion model which presumes the planetary embryo commenced with clumping of dust grains. The latter mechanism is favored for rocky planets, and some favor it for some or all of the giant planets as well, e.g., to explain those that have rocky-planet-like cores. It presumes the presence material that can become solid, i.e., metals, thus assumes a certain metallicity in the disk and star, an assumption testable by survey. Whether a planet ends up rocky or gas/giant may well depend upon how much gas is left in the disk: protoplanetary disk lifetimes are sufficiently short that gas could disappear during the process (pulled into planets, the host star, and blown free, e.g., by the host's radiation pressure). For giant planets, a commencement through core accretion is colloquially known as cold start, because it is thought that it would leave significantly less heat in the planet than gravitational instability, which is thus known as hot start: these alternatives are thought to affect the subsequent composition of the planet, which in turn, can be used to determine the planet's type of formation. A factor in the formation process is whether the formation occurs beyond the snow line, in which case, the dust may include volatiles such as ice, which within the subsequent planet may be heated to liquid or gas.
Gravity plays a role in both gravitational instability and in the accretion of gas forming atmospheres. A Keplerian disk is no more than a first approximation of a protoplanetary disk, with radiation pressure and gas pressure playing roles, as well as dynamical interaction such as wind shear (WISH). A radius around a growing planet where its gravity dominates is not the same as the Hill radius, but is smaller because it includes other effects (e.g., Bondi radius).
The assumption is that dust may be inherited from the molecular cloud forming the host star, and/or may form in the disk from gas, after which it combines into small solid bodies of increasing scale up to planet sized. The challenge is to provide plausible means by which growth can continue at each size, and the specific challenges are commonly referred to as barriers, i.e., places in the growth process where there are seeming impediments to further growth. One notion is that protoplanetary disks form striae such that dust collects into pebble-size bunches, and that the fluid dynamics of the disk tend to bring these to the forming planets (pebble accretion).
Oligarch theory suggests after a period of rapid growth (i.e., runaway growth), the largest objects (oligarches) grow faster than the rest for some time, eventually throwing many of the smaller objects out of the system and/or consuming them during impacts. Some are thrown into eccentric orbits, risking more impacts, but while the disk exists, the orbits are damped and will tend to circularize. (With no disk, gravitational pumping encourages eccentricity, and thus collisions.) For some time after that, giant impacts could result in merger of some planet-sized bodies (as per the theory of the formation of the Moon). Such impacts also drive away some of the atmosphere.
Evidence for planet forming theories is sought in the Earth's makeup: e.g., the evidence for a giant impact creating the Moon, as well as the phenomenon of Earth's outer layer containing some materials that would be expect to sink toward the center during Earth's early rock-melting-temperature period, suggesting these materials were gained later. There is geochemical evidence that Earth's formation occurred over 100 million years, e.g., from moon rocks and meteorites.
It has been suggested that a relationship between planet's rotation (specifically, its equatorial rotation velocity) and its mass, i.e., on a log-log plot, is a signature of its formation process since all solar-system planets fit a relationship that distinguishes them from brown dwarfs. However, these planets have rotation periods in the same order-of-magnitude so the actual relationship shown could be radius versus mass.