Planet Formation, the process by which planets form, is not completely understood: theories of parts of the process seem solid, but others are not settled upon, with some parts 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.
The Nebular Hypothesis is well accepted regarding the source of the material, the Gravitational Instability Model explains the "clumping" of mass necessary to get things started and the Core Accretion Model is a good explanation of how planets grow larger than Rocky Planets (e.g., Giant Planets).
Core Accretion assumes a certain Metallicity, and suggests more planets around stars with higher metallicity. Such a tendency can be tested by Survey. This 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, and it is thought to affect the subsequent composition of the planet, which in turn, can be used to determine the planet's formation pattern.
The assumption is that Dust forms from gas, and 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. Some barriers cited include:
Recent models suggest that Protoplanetary Disks form Striae such that dust collects into pebble-size bunches, and that the aerodynamics 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 Moon's origin). Such impacts also push off 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 spin (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 Dwarves. However, these planets have rotation periods in the same order of magnitude so the actual relationship shown could be radius versus mass.