 Here is a look at what's happening at the electron level. The electrons are bouncing off each other. It's the electromagnetic force of negative charge to negative charge repulsion that causes the bounce. This is called the Coulomb force. You can see from Coulomb's law that the force gets very large when the distance between electrons gets very small. This is the same force that prevents your hands from going through each other when you clap. Now let's add enough mass to get to the size of the exoplanet WASP-12B. It's the largest exoplanet discovered to date. At the electron level, we see the density of the electrons are going up at the same time that the electrons are moving faster. That's their temperature going up. It's the faster movement that creates the increase in outward pressure that counters the increased inward gravitational pressure. WASP-12B is only 40% more massive than Jupiter, but it has almost twice the volume. But as we continue to add mass, the inward gravitational forces begin to overwhelm the outbound Coulomb forces. The matter density prevents the electrons from moving. Therefore increases in temperature slow down. Outward thermal pressure does not go up to meet the added inward pressure caused by the added mass. The gas is said to have become degenerate. The laws of quantum mechanics start to overtake the laws of thermodynamics. The Pauli exclusion principle that no two electrons can occupy the same quantum state comes into play. Based on this principle, an outward pressure is created that prevents a total collapse. It's called electron pressure. For our purposes, it is important to note that it is temperature independent. It depends only on the matter density. Electron pressure is extremely powerful. It takes almost 1500 Jupiters to create a gravitational force large enough to exceed it. It's the force that keeps white dwarfs from collapsing. As this effect becomes dominant, adding matter causes the planet to shrink in size. The maximum size depends on the planet's composition. We see that a pure hydrogen planet would have a maximum radius almost three times the maximum radius of a pure helium planet. Hat P to B is one of the most massive planets known so far. It has six times the mass of WASP-12B, but it's 30% smaller.