Theory:

We have studied how the electrons are arranged in an atom of different shells or orbits.
The electrons that are found in an atom's outermost orbit are called valance electrons.
The charge of an atom is decided by the loss or gain of electrons. An atom becomes positive when it looses an electron and negative when it gains an electron. The difference between valence and charge is that valence has no symbol, while charge has both positive and negative signs.
 
Capture4.JPG
Formation of anion and cation from a neutral atom
 
Atoms are continually trying to achieve a stable state.
 
Example for an atom losing electron: Sodium
 
Atomic number of sodium = \(11\)
 
Number of electrons in \(Na\) = \(11\)
 
So, the electronic configuration is (\(2, 8, 1\)). It needs to lose one electron to attain a stable state.
 
NaNa++e (Loss of an electron)
 
Thus, the electronic configuration of \(Na^+\) is (\(2, 8\)).
 
Example for an atom gaining of an electron: Chlorine
  
Atomic number of \(Cl\) = 17
 
Number of electrons in \(Cl\) = 17
 
So, the electronic configuration of \(Cl\) is (\(2, 8, 7\)). It needs to gain one electron to attain a stable state.
  
Cl+eCl (Gain of an electron)
 
Thus, the electronic configuration of \(Cl^-\) is (\(2, 8, 8\)).
 
What is meant by a stable state?

If an atom has only one shell, the stable state is achieved when two electrons are present in it. Similarly, when an atom has two shells, the stable state is achieved when the outermost shell has eight electrons. Just a few elements such as (He\), \(Ne\) and \(Ar\) have this condition.
 
shutterstock_1932228527.jpgshutterstock_1932656684.jpgshutterstock_1933402307.jpg
Electron distribution in \(He\), \(Ne\) and \(Ar\)
 
The atoms that do not have this octet are involved in bond formation by gaining, losing, or sharing electrons.
 
Who decides how many electrons will be involved in the formation of a bond?
  
shutterstock_1737401561.jpg
 
The answer to this question is "Valency".