Hydrogen fusion to helium is the primary energy source for main sequence stars. That something is the pressure of ever-hotter and denser layers of gas as you go deeper into the star. Thus, you can have high density while at the same time have particles very far apart compared to their size, acting like an ideal gas. The increase in temperature as one goes down into a star reflects the necessity of transporting the energy generated at the center of the star to the surface. This is not a very important mechanism in the sun, but it can become important in some circumstances we'll run into later.
Hot gas is moved, and then shared out with surrounding cooler gas, thereby transporting heat energy.
It takes a few hundred thousand years for energy to reach the surface by this tortuous route. The amount of energy flowing by each of these routes is determined by the nature of the stellar material, and different mechanisms are generally important at different depths. Copyright 2000 by James N. Douglas. All rights reserved.