Dust clumps around stars become pebbles, pebbles become larger rocks that grind together to expand. The presence of gas helps particles of solid material stick together. Some break apart, but others hold on. These are the building blocks of planets.