Lithium-ion (Li-ion) batteries that rely on cationic redox reactions are the primary energy source for portable electronics. One pathway toward greater energy density is through the use of Li-rich layered oxides. The capacity of this class of materials (>270 milliampere hours per gram) has been shown to be nested in anionic redox reactions, which are thought to form peroxo-like species. However, the oxygen-oxygen (O-O) bonding pattern has not been observed in previous studies, nor has there been a satisfactory explanation for the irreversible changes that occur during first delithiation. By using Li2IrO3 as a model compound, we visualize the O-O dimers via transmission electron microscopy and neutron diffraction. Our findings establish the fundamental relation between the anionic redox process and the evolution of the O-O bonding in layered oxides.