The detailing of the intermolecular interactions in dense solid oxygen is essential for an understanding of the rich polymorphism and remarkable properties of this element at high pressure. Synchrotron inelastic x-ray scattering measurements of oxygen K-edge excitations to 38 GPa reveal changes in electronic structure and bonding on compression of the molecular solid. The measurements show that O(2) molecules interact predominantly through the half-filled 1pi(g)* orbital <10 GPa. Enhanced intermolecular interactions develop because of increasing overlap of the 1pi(g)* orbital in the low-pressure phases, leading to electron delocalization and ultimately intermolecular bonding between O(2) molecules at the transition to the epsilon-phase. The epsilon-phase, which consists of (O(2))(4) clusters, displays the bonding characteristics of a closed-shell system. Increasing interactions between (O(2))(4) clusters develop upon compression of the epsilon-phase, and provide a potential mechanism for intercluster bonding in still higher-pressure phases.