Think about it like this: they aren’t made of gasses because they’re larger planets, they’re larger planets because they’re made of gasses. Gasses are (generally) “lighter” (less dense) than solid matter and are affected less by the planets gravity accordingly. Gas giants are larger (more massive) but often have much lower density (e.g. Jupiter is about 10 times larger than Earth and about 2.5 times as massive as every other planet in the solar system combined, but is only about 1/5th as dense as Earth.)
Latest Answers