Planet formation in protoplanetary disks is a complex process involving several stages. Initially, dust grains collide and stick together, forming planetesimals. These planetesimals can further collide and merge to form protoplanets. In the case of gas giants, once a protoplanet reaches a certain mass, it can attract a significant amount of gas from the disk, forming a massive atmosphere. This process is known as core accretion.