Physical chemistry · The first law: work, heat and internal energy

Expansion work against a constant pressure

Energy leaves or enters a gas as work when it pushes against its surroundings, and the amount depends on what pushes back.