Metal-organic frameworks (MOFs) are coordination networks with organic ligands containing potential voids. Some MOFs show pronounced structural flexibility that may result in closing and re-opening these pores. Here, we show that collective flexibility in a MOF-DUT-8(Ni) - is controlled by conformational isomerism. DUT-8(Ni), a pillared-layer MOF with Ni2 paddle-wheels, dabco pillars and naphthalene dicarboxylate (ndc) linkers, can crystallize in many conformational isomers that depend on the orientation of the non-linear ndc linkers with respect to each other. While the open form is compatible with several of these conformations, only one of them, with alternating linker orientations, is stable as the closed form. We show, by means of first principles calculations, that in the stable closed form, the appreciable lattice strain is compensated by London-dispersion forces between the ndc linkers that arrange with maximum overlap in a stacking order similar to the stacking in graphite. We substantiate these results by well-tempered metadynamics calculations on the DFT-based Born-Oppenheimer potential energy surface, by refined X-ray diffraction data and by nitrogen adsorption data obtained by experiment and grand-canonical Monte-Carlo simulations based on the DFT-optimized and PXRD-derived geometries. While the reported origin of flexibility cannot be generalized to all flexible MOFs, it offers a rational design concept of folding mechanisms in switchable MOFs by exploitation of the stabilization effect of linker stacking in the closed form.