How does an irreversible process maintain internal energy while dissipating excess heat? From my understanding, if you were to look at a pressure-volume graph of a reversible, isothermal expansion, the area under it would represent reversible work. Similarly, if you were to graph an irreversible, isothermal expansion on top of this graph, you’d see a smaller rectangular area representing the irreversible work.

What I have been told is that the area between these areas, irreversible and reversible, is wasted energy dissipated as heat. This confuses me, however. If the work the irreversible system does is less, then it should draw less heat from the surroundings (w=-q). So, if it still releases the same quantity of energy, just more of it as heat and less as work, then how would it maintain a constant internal energy? In other words, if the system dissipates the unused work as heat, which is not replenished, then how does it stay at constant T?
The change in entropy of the system in both cases is the same, but, in the irreversible case, the entropy of the surroundings decreased less.  This is because less heat was transferred from the surroundings to the system.  In this sense, all the entropy generated within the system in the irreversible process is transferred to the surroundings.  So the interpretation would be that the &quot;heat generated&quot; within the system causes less heat to be transferred from the surrounding to the system and less work to be done.  In my judgment, this is a desperate attempt to provide some physical interpretation to what is happening.