A drug’s selectivity for target receptors is essential to its therapeutic utility, but achieving selectivity between similar receptors is challenging. The serendipitous discovery of ligands that stimulate target receptors more strongly than closely related receptors, despite binding with similar affinities, suggests a solution. The molecular mechanism of such ‘efficacy-driven selectivity’ has remained unclear, however, hindering design of such ligands. Here, using atomic-level simulations, we reveal the structural basis for the efficacy-driven selectivity of a long-studied clinical drug candidate, xanomeline, between closely related muscarinic acetylcholine receptors (mAChRs). Xanomeline’s binding mode is similar across mAChRs in their inactive states but differs between mAChRs in their active states, with divergent effects on active-state stability. We validate this mechanism experimentally and use it to design ligands with altered efficacy-driven selectivity. Our results suggest strategies for the rational design of ligands that achieve efficacy-driven selectivity for many pharmaceutically important G-protein-coupled receptors.