Inositol hexakisphosphates (IP6) are cellular cofactors that promote the assembly of mature capsids of HIV. These negatively charged molecules coordinate an electropositive ring of arginines at the center of pores distributed throughout the capsid surface. Kinetic studies indicate that the binding of IP6 increases the stable lifetimes of the capsid by several orders of magnitude from minutes to hours. Using all-atom molecular dynamics simulations, we uncover the mechanisms that underlie the unusually high stability of mature capsids in complex with IP6. We find that capsid hexamers and pentamers have differential binding modes for IP6. Ligand density calculations show three sites of interaction with IP6 including at a known capsid inhibitor binding pocket. Free energy calculations demonstrate that IP6 preferentially stabilizes pentamers over hexamers to enhance fullerene modes of assembly. These results elucidate the molecular role of IP6 in stabilizing and assembling the retroviral capsid.