I have been trying to visualize how a gas giant like Jupiter originally formed. I am assuming that in its early stages it formed by aggregation similar to how the rocky inner planets were with an abundance of heavy elements found in roughly the same proportions as earth's. I am further assuming that as Jupiter amassed far more material than its rocky neighbors, the resulting pressures, temperatures and tidal forces increased to such a degree that a fundamental change began to occur where the heavy elements were being broken down into lighter ones on the periodic table. What sequence of events would take place such that a heavy element like gold, lead or iron would be reduced to hydrogen and helium such as is reported to be the primary elemental makeup of Jupiter.
As a thought experiment, I have been trying to visualize what would happen to a huge asteroid, a moon, or say the earth itself if it were to collide with such a gas giant. Would all the heavier elements be reduced to one of these two elements as the bulk of the earth's mass began to settle into Jupiter's core region?