Ions are atoms that have gained or lost electrons, giving them an electrical charge. Atoms that lose electrons become positively charged cations, while atoms that gain electrons become negatively charged anions. The number of protons and neutrons remain the same in an ion, only the number of electrons changes. Ionic bonding occurs through the transfer of electrons from one atom to another, while covalent bonding involves the sharing of electron pairs between two atoms. Sodium chloride is an example of ionic bonding through electron transfer, while an oxygen molecule is held together by covalent bonding from shared electron pairs.