It turns out that terms representing the kinds of energy in a system generally are products of two factors. One factor is an extensive variable (depends on how much of the system you consider), and the other is intensive (does not). For example, $PV$: $P$ is intensive, $V$ extensive, or $\mu N$: $\mu$ (the chemical potential of a species) is intensive, $N$ (the number of molecules of the species) is extensive, or $VQ$: $V$ (not volume, but electrical potential) is intensive, $Q$ (charge) is extensive. These pairs are called "thermodynamically conjugate."
An infinitesimal change in energy of the system can occur either with a change of the extensive variable or the intensive one: e.g. $-PdV$ or $-(dP)V$. For any extensive variable other than entropy, when the extensive variable changes, work is being done (e.g. $-PdV, \mu dN, V dQ$). This is analogous to (and sometimes equal to) a force acting over some distance. Any additional change of internal energy (e.g. $dU + PdV - \mu dN - VdQ -$ (other changes associated with extensive variables)) is associated with heating, and equals $TdS$.