Physical chemistry · The first law: work, heat and internal energy
Energy leaves or enters a gas as work when it pushes against its surroundings, and the amount depends on what pushes back.