  The formation of a spin glass usually requires both structural disorder and
frustrated magnetic interactions. Consequently, the origin of spin-glass
behaviour in Y$_2$Mo$_2$O$_7$ $-$ in which magnetic Mo$^{4+}$ ions occupy a
frustrated pyrochlore lattice with minimal compositional disorder $-$ has been
a longstanding question. Here, we use neutron and X-ray pair-distribution
function (PDF) analysis to develop a disorder model that resolves apparent
incompatibilities between previously-reported PDF, EXAFS and NMR studies and
provides a new and physical mechanism for spin-glass formation. We show that
Mo$^{4+}$ ions displace according to a local "2-in/2-out" rule on each Mo$_4$
tetrahedron, driven by orbital dimerisation of Jahn-Teller active Mo$^{4+}$
ions. Long-range orbital order is prevented by the macroscopic degeneracy of
dimer coverings permitted by the pyrochlore lattice. Cooperative O$^{2-}$
displacements yield a distribution of Mo$-$O$-$Mo angles, which in turn
introduces disorder into magnetic interactions. Our study demonstrates
experimentally how frustration of atomic displacements can assume the role of
compositional disorder in driving a spin-glass transition.
