Heating a gas changes the state of the gas. But the state of a gas can be changed in a wide variety of ways. On another slide, we show how work done on a gas also changes the state of the gas. The amount of work that a gas can do depends on both the initial and final states and on the process used to make the change. In the same way, the amount of heat transferred in changing the state of a gas also depends on the initial and final states and the exact process used to change the state.
Different processes result in different amounts of heat flow and work.
The effects of both heat flow and work are combined in the First Law of Thermodynamics.