In this article, we present a theory of macroscopic contact angle hysteresis by considering the minimization of the Helmholtz free energy of a solid-liquid-gas system over a convex set, subject to a constant volume constraint. The liquid and solid surfaces in contact are assumed to adhere weakly to each other, causing the interfacial energy to be set-valued. A simple calculus of variations argument for the minimization of the Helmholtz energy leads to the Young-Laplace equation for the drop surface in contact with the gas and a variational inequality that yields contact angle hysteresis for advancing/receding flow. We also show that the Young-Laplace equation with a Dirichlet boundary condition together with the variational inequality yields a basic hysteresis operator that describes the relationship between capillary pressure and volume. We validate the theory using results from the experiment for a sessile macroscopic drop. Although the capillary effect is a complex phenomenon even for a droplet as various points along the contact line might be pinned, the capillary pressure and volume of the drop are scalar variables that encapsulate the global quasistatic energy information for the entire droplet. Studying the capillary pressure versus volume relationship greatly simplifies the understanding and modeling of the phenomenon just as scalar magnetic hysteresis graphs greatly aided the modeling of devices with magnetic materials.