Mechanical work performed on a working fluid causes a change in the mechanical constraints of the system; in other words, for work to occur, the volume must be altered.
Volume is one of a pair of conjugate variables, the other being pressure.