Resonance is the averaging of multiple possible electron configurations. The resonance creates stability of the electrons in the atom.
Complex ions can achieve stability by averaging or combining all the different possible arrangements of the electrons. The stable structure created is called a resonance structure.
For example Carbonate
Carbon can from only four bonds. Each Oxygen can form two bonds. So the three Oxygens need six bonds to be stable yet Carbon can only provide four. Each Oxygen tries to gain two bonds from the Carbon leaving the other two Oxygens with only 1 bond.
The other two Oxygens are not stable with only one bond so the other Oxygens in turn try to obtain 2 bonds. These possible bonding configuration shift back and forth so rapidly that the structures are averaged. This leaves each Oxygen with 1.333 or 1 and 1/3 bonds. The total complex is left with a charge of -2.
However because the -2 charge is spread between all three Oxygens the complex is more stable than the complex would be if the charge was on only two of the Oxygens. The resonance makes Carbonate
Whenever you can write more than one Lewis structure for a compound, the actual structure of the compound is none of the structures.
Rather, it is a resonance hybrid of them all.
Resonance is the general term we use to describe this situation.
For example, we can write three different structures for the carbonate ion,
The actual structure is an average or resonance hybrid of all three structures, and each structure is called a resonance contributor to the hybrid.
We say that the electrons are delocalized and are free to extend over all four atoms in the ion.