The gravitational instability theory suggests that planets form when gas and dust sticks to itself and collapses. The core accretion theory suggests that planets form when a core of rock and ice attracts gases.