how a heat engine works
A heat engine takes heat QH from a hot source, turns part of it into work W, and rejects the rest QC to a cold source. It runs in a cycle and returns to the start each turn, so the net work is the heat received minus the heat rejected. The difference between what is taken and what is thrown away remains each turn.
Drag how much of the heat in becomes work and the rest is seen rejected to the cold source. A real car engine or power plant turns only about a third of the fuel heat into work, and the rest leaves as hot exhaust and cooling water. Most of it never becomes work and leaves as heat.
An engine runs around a closed loop on the P-V plane, and the area the loop encloses is the net work of one cycle. The net work is positive only when the loop is clockwise, and run the other way it is a refrigerator that has to be given work. The direction of the turn splits engine from refrigerator.
Around one cycle the gas returns to the starting state and the change in internal energy is 0, so QH = W + QC. Internal energy is fixed by the state alone, so whatever path is taken, coming back to the start makes that change 0. Split the heat in into work and rejected heat and the structure shows.
The efficiency is η = WQH = 1 - QCQH. It depends only on the ratio of the heat rejected to the heat received, so cutting the rejected heat is the only way to raise the efficiency. Compare a weak engine and a strong one and the difference shows. The less heat rejected, the more work from the same heat in.
Emphasize the three flows one at a time and the limit shows. Heat must leave, so the efficiency is always less than 1, and why is taken up by the 2nd law in the next chapter. Because this QC must be rejected, a power plant stands by a river or a huge cooling tower and pours waste heat without pause. Without a cold place the loop does not close.