The Sun and the planets orbiting it were formed from a massive cloud filled with gas (primarily hydrogen) and solid particles. This cloud appeared approximately 4.6 billion years ago.
The planets closer to the Sun are hotter, allowing them to retain larger amounts of these lighter gases. However, the first four planets nearest the Sun are relatively small, resulting in weaker gravitational forces.
In contrast, the outer regions of the solar system host larger planets that formed from cooler hydrogen, making it easier for them to retain greater amounts of hydrogen.
The gravitational force of the giant planets significantly exceeds that of Earth. If Jupiter had a solid surface, a person standing on it would weigh three times more than their weight on Earth. Their legs would not be able to support their body. The gravity of these giant planets prevents lighter gases from escaping into space.
T.H