The internal energy that lies deep within the giant planets is primordial. In other words, it is left over from their formation. Though they have much smaller masses than the Sun, the giant planets formed much like collapsing protostars. Recall that as a mass of gas collapses under the force of its own gravity, it converts its gravitational potential energy to thermal energy (see Chapters 4 and 7). The gaseous planets continue to contract, releasing their gravitational potential energy as they shrink. This is the primary energy source for replacing the internal energy that leaks out of the interior of Jupiter. It is probably an important source for the other giant planets as well.