Oxide ion is formed when a neutral atom of Oxygen accepts two electrons
Atoms can gain or lose electrons in chemical reactions to change their electron configuration to one that is more stable, usually in accordance with the octet rule.
Since oxygen has six electrons in its neutral state, adding two more electrons enables it to resemble the noble gases and have a complete outer shell of eight electrons. Now stable, the resulting oxide ion has a 2-charge and is frequently present in a variety of ionic compounds.