Inert pair effect is defined as
The non-participation of the two s electrons in bonding due to the high energy needed for unpairing them.
Electrons orbit around the nucleus in different energy levels called as shells or principle quantum number n. Each consecutive shell has greater energy as it moves away from the nucleus. Each shell is further divided into subshells and orbitals like s, p, d, f in which electrons are distributed as follows:
Electrons from the outermost shell are responsible for bonding. The inert-pair effect is the tendency of the outermost s-orbital electrons to not participate in chemical reactions. It occurs mainly in elements that come after the transition elements in the periodic table. The inert pair effect describes the preference of late p-block elements to form ions with an oxidation state of 2 less than their group valency. The 2 electrons from s orbital are less likely to take part in chemical reactions and they are harder to remove via ionization, because once other electrons from higher energy orbitals are removed the atomic radius decreases and does not overlap with other reactants. So, while lighter p-block elements usually "give away" their s and p electrons when they form chemical compounds, heavier p-block elements tend to "give away" their p electrons but keep their s electrons.
Example: Al(III) is preferred over Al(I) but Tl(I) is preferred over Tl(III) although both are in the same group.