each layer is in hydro-static equilibrium, it's weight balanced by the extra pressure below it compared to the pressure above it, and so we obtain high pressure and high temperature in the core with decreasing pressure and temperature towards the outside.