They melted after solar system formation, releasing stored gases in the rocks.
They formed at higher temperatures than the terrestrial planets.
They accumulated at sufficiently great orbital distances that these volatile materials were ices and liquids.
They were deposited into the solar system by passing comets after the solar system had already formed.
They formed much more slowly, after the terrestrial planets already had a chance to form.