Specifically, in NaOH, sodium loses one electron to oxygen, forming positively charged sodium ions (Na+) and negatively charged oxide ions (O2-). These ions are then strongly attracted to each other due to their opposite charges, resulting in the ionic bond between sodium and oxygen.