Picture of a planet which is almost finished its forming process "swimming" through gases and dusts surrounding its mother star. The planet might pull some gases and dusts and form its atmosphere which could disintegrate away when it gets closer to the star. From this process, gas giants could turn in to rocky planets.
As I learned from the Ay20 class today, Kepler mission has found more than 1200 planet candidates. One quarter of that amount are expected to be "super-earth." Several studies suggest that those rocky planets might be a result of failed formation of Jupiter-sized gas giants.Most astronomers believe that a planet is formed by the core accretion process. Huge disk of gas surround the new born planet. Dusts in the disk stick together and become larger objects called planetesimals which collide with each others to create bigger and bigger objects. When the substance's mass reaches the critical point, its gravitation starts to pull in gases in the disk.
However, Sergei Nayakshin from University of Leicester in United Kingdom proposes a new theory called tidal downsizing which should work at faster rate. In that theory, a disk of gas is formed into a big ball of gas with a distance further away from most planets in solar system. Those gases get colder and shrink into a huge planet (around 10 times mass of Jupiter.) In this contraction, dust particles develop into a larger object and fall into the core of the gas ball. Thus, new born rocky planet is hidden inside the ball of gas.
As Nayakshin explained, when you have a core, it might create atmosphere around it. The atmosphere is mostly consisted of hydrogen but it still has more chemical element than the fossil dust element. Bigger the core, larger the atmosphere. Moreover, the atmosphere also grow with time which ends as a gas giant with rocky core, for example, super Jupiter.
Nevertheless, the surrounding disk pulls a planet toward a star so the outer atmosphere of the planet is pulled and disturbed by the star. Thus, before a planet completes its formation, almost all of its atmosphere is stolen. What is left is the rocky core and a thin layer of atmosphere since it is more dense. The left over rocky core should be very similar to rocky planets that we known of. It could have a mass from zero to 10 times of Earth mass.
After that, a planet can continues its journey toward the star or drifts away into a place called habitable zone (places where liquid water can exist on a surface of a planet) which is unique for each star. Those stars orbit in the habitable zone have a great likelihood of having living organisms.
space.com: some rocky planets could have been born as gas giants