Gas, just like solids and liquids, has mass. This means that it generates gravity as well as gets pulled on by gravity.
So even a big cloud of gas will attract itself and clump together. Get enough gas and that gravity can be really strong and compress the clump a lot.
That said, solid matter does end up in those planets, they’re just mostly gas.
Latest Answers