explain how ions are formed o2