How are ions made from neutral atoms?
In neutral atoms, the number of protons is equal to the number of electrons.
In metals, the electrons in the outermost shell are loosely bound to the nucleus.
When a definite amount of energy called ionization energy is supplied to the atom, this loosely bound electron gets the energy needed to overcome nuclear attraction and thus it becomes free and gets released, usually to a nonmetallic atom. This causes a charge imbalance making the atom a positively charged cation due to deficiency of electron.
In nonmetals, the valence shell is at least half-filled, and the electrons are tightly held by the nucleus. These atoms need to acquire electrons, which generally come from metallic atoms.
When an electron is added to an atom, a definite amount of energy is released called electron affinity resulting in a charge imbalance, making the atom a negatively charged anion due to excess of electron.