The amount of heat they are exposed to has a lot to do with the inferences and observations that they make on the density of the earth's core. The inner core is the most compact due to the fact that they have a lot of direct exposure to heat and the gravity of the earth pressung down on it. The inner core is less subjected to those conditions.