Unit content
Pressure-volume work at constant external pressure
When a gas or other compressible system changes volume against an external pressure, energy can be transferred as pressure-volume work.
Consider a piston of area $A$ moving a distance $\Delta x$ against a constant external pressure $p_{\mathrm{ext}}$. The resisting force magnitude is
$$F=p_{\mathrm{ext}}A,$$
and the volume change is
$$\Delta V=A\Delta x.$$
Therefore the work done by the system on the surroundings is
$$\boxed{W_{pV}=p_{\mathrm{ext}}\Delta V}$$
when the external pressure is constant.
Under the thermodynamic sign convention
$$\Delta U=q-W,$$
an expansion has $\Delta V>0$ and therefore $W_{pV}>0$: the system does work on its surroundings. A compression has $\Delta V<0$, so $W_{pV}<0$: the surroundings do net pressure-volume work on the system.
Example
A gas expands from $2.0,\mathrm L$ to $5.0,\mathrm L$ against a constant external pressure of $100,\mathrm{kPa}$.
The volume change is
$$\Delta V=3.0,\mathrm L.$$
Since
$$1,\mathrm{kPa,L}=1,\mathrm J,$$
we obtain
$$W_{pV}=(100,\mathrm{kPa})(3.0,\mathrm L)=300,\mathrm J.$$
The gas has transferred $300,\mathrm J$ of energy to its surroundings as expansion work.
The external pressure matters because it is the mechanical resistance actually pushed against. When pressure varies during a process, the simple product $p_{\mathrm{ext}}\Delta V$ must be replaced by an accumulation of work over the changing volume. The constant-pressure result is the simplest case of that more general boundary-work calculation.