well..i like your question...
everything occurs due to electron movement.the work and the energy depend on that(that is E=qv,where E=energy,q=charge,v=potential difference)
during the movement of electron,it experiance some resistance. it causes energy loss in the form of heat.so the gpu/cpu get...