Metal-organic frameworks (MOFs) are promising solid sorbents, showing gas selectivity and uptake capacities relevant to many important applications, notably in the energy sector. To improve and tailor the sorption properties of these materials for such applications, it is necessary to gain an understanding of their working mechanisms at the atomic and molecular scale. Specifically, it is important to understand how features such as framework porosity, topology, chemical functionality and flexibility underpin sorbent behaviour and performance. Such information is obtained through interrogation of structure-function relationships, with neutron powder diffraction (NPD) being a particularly powerful characterization tool. The combination of NPD with first-principles density functional theory (DFT) calculations enables a deep understanding of the sorption mechanisms, and the resulting insights can direct the future development of MOF sorbents. In this paper, experimental approaches and investigations of two example MOFs are summarized, which demonstrate the type of information and the understanding into their functional mechanisms that can be gained. Such information is critical to the strategic design of new materials with targeted gas-sorption properties.