Gravitational compression
Gravitational compression is a theory wherein gravity, acting on the mass of an object, compresses it; the compression increases the object's density and reduces it's volume.
The Sun is a good example, wherein the surface of the Sun is thought by some to be pulled downwards by the Sun's own gravity. This may cause it to push down on the layer immediately below, thus increasing the pressure, and therefore the density of that layer. The higher density would allow more mass to be closer to the Sun's center and increase the gravity, leading to a compounding effect. This effect to extend all the way down to the solar core, where the pressure of all the layers above it causes the density to rise dramatically. Without this compounding effect to result in a greater frequency of collisions between particles, nuclear fusion within the Sun could not occur; or so it is theorized.
The same process can increase the density of other objects in the solar system to lesser degrees. It is conjectured to be responsible for the higher density of Saturn's moon Titan compared with the rest of Saturn's moons (despite Titan being composed of the same material as the other moons!?!). The increase in gravitational compression with size may also explain why Earth is the densest planet in the Solar System even though Mercury is composed of much denser materials and has a much larger core relative to its diameter.