This is because cheese has a fairly high heat capacity.
The amount of heat energy [itex]Q[/itex] added to substance of mass [itex]m[/itex] that undergoes is a temperature change [itex]\Delta T[/itex] is [itex]Q = c m \Delta T[/itex], where [itex]c[/itex] is the substance's (specific) heat capacity.
Cake has a lower heat capacity than cheese and grease (from the pepperoni), so if cake and pizza are both sampled fresh out of the same oven, the pizza does more damage, since it has the capacity to supply more energy to the tongue and mouth.
As we experience life, we continually "do the experiment" (as I will on Wednesday night while watching the hockey game), and we build up a storehouse of information about heat capacities (and other things) that becomes part of our intuition of how to eat.