Not all of the electrical energy consumed by the CPU is used by the CPU for computational work. Some of the electrical energy transfers out of the CPU to other components. The TDP of the CPU is not concerned with those other components. TDP is not a useful measurement of the amount of electrical energy a CPU can consume.
All consumed energy is used to produce heat, by definition of "consumption". If some electrical energy transfers out of CPU to other components (this is indeed possible), then by definition this energy is not consumed by the CPU. The meaning of TDP is explained in the article - Intel's value of TDP was such a measure, but is no longer so.