Staphylococcus aureus pathogenicity islands (SaPIs), such as SaPI1, exploit specific helper bacteriophages, like 80α, for their high frequency mobilization, a process termed ‘molecular piracy’. SaPI1 redirects the helper’s assembly pathway to form small capsids that can only accommodate the smaller SaPI1 genome, but not a complete phage genome. SaPI1 encodes two proteins, CpmA and CpmB, that are responsible for this size redirection. We have determined the structures of the 80α and SaPI1 procapsids to near-atomic resolution by cryo-electron microscopy, and show that CpmB competes with the 80α scaffolding protein (SP) for a binding site on the capsid protein (CP), and works by altering the angle between capsomers. We probed these interactions genetically and identified second-site suppressors of lethal mutations in SP. Our structures show, for the first time, the detailed interactions between SP and CP in a bacteriophage, providing unique insights into macromolecular assembly processes.