Pre-Requisite Reading: Lewis Structures, Types of reactions, Using curly arrows for electron movement, Identifying Functional groups.
Why is resonance important in Chemistry?
An attempt to describe the nature of the covalent bond between atoms began with Gilbert N. Lewis in his landmark paper ‘The Atom and the Molecule’ in 1916.
He tried to give a complete electronic picture of the molecule by joining two atoms using two electrons. The electrons were denoted as dots between the atoms, one dot for one electron. The electrons unused in bonding were also shown above the atoms' symbol as lone pairs. For example,

Following Lewis’s rule for drawing the molecules’ structure using the electron-dot method (which was later replaced by a dash for the covalent bonds) resulted in some molecules having more than one way of representation.
For example,
The molecule Benzene can be drawn as,

Similarly, multiple Lewis structures can be drawn for molecules like Ozone (O3), Acids (R-COOH), Carbon dioxide (CO2), Carbonate ion (CO32-), Nitrate ion (NO3-), 1,3-butadiene (CH2=CH-CH=CH2), etc.

In such instances, when a molecular structure could be represented by more than one electronic structure, each structure was found to explain most of the properties. Still, not one structure could explain all the properties.
For example, the Lewis structure of Benzene shows single and double bonds. Still, it could not explain why all the bonds behaved equally also, why Benzene showed a substitution reaction and not an addition reaction, which is typical of the double bonds.

Similar observations were seen in double-bonded CO2 and other molecules as well. The bonds in CO2 showed some triple bond character with the bond length of 1.15 Ao intermediate to Carbon-Carbon double (bond length 1.22 Ao) and a triple bond (1.10 Ao).

These observations led to the postulation that electrons in such structures aren’t localized but are delocalized. So, while Lewis structures depicted the concentration of two electrons between the atoms, its shortcoming in explaining the irregularities in the bond length was overcome by the proposition of electron delocalization.
Electron Delocalization/Resonance
The electrons are assumed to be not localized between the two atoms of the bonds but are shared with more than two atoms’ nuclei.
And since such multiple Lewis structures were predominantly seen in molecules with multiple bonds and heteroatoms with lone pairs of electrons, it was assumed these labile electrons (pie bond and lone pairs) participate in the electron delocalization.

For example, in the above examples, Benzene and alkyl carboxylic acid are represented with two Lewis structures. The bond length discrepancy of both Benzene and carboxylic acid is thought to be due to electron delocalization. The probable electron movement is predicted using the curly arrows.
The various Lewis structures are called the canonical/contributing/resonance structures. A double-headed arrow separates these canonical structures. These resonance structures do not represent another molecule but are hypothetical predictive structures, and therefore, they cannot be isolated as individual molecules. Rules known as ‘Rules of Resonance’ assist in predicting these canonical structures. Also, some structures are more favorable than others and are assigned the highest priority.

As seen from the examples of resonance structures below, the relative positions of the atoms remain unchanged; the only thing that changed was the electron position without affecting an atom’s valency.

For example, post electron delocalization, a Carbon atom cannot have more than four bonds, or Nitrogen cannot have five bonds.
Partial Bond Character due to Resonance
The path along which the electron movement takes place develop a partial bond character affecting the bond length, as seen in the bond lengths of Benzene and CO2.
The electron’s path indicating the partial bonds is shown in dashed lines (----) or curves.

In Benzene and aromatic systems, the delocalization of the electrons is shown as a circle -


Resonance hybrid
Each canonical structure shows a localized bond explaining some of the molecules’ properties. For example, resonance structures 2 and 3 (shown below) explain the triple and single bond nature of CO2, whereas structure 1 describes the double bond nature.

The average of all the canonical structures is called the resonance hybrid, representing the averages of all the properties.
For example, the acetate ion can be depicted using three Lewis structures. The true acetate ion’s nature is closer to structures A and B. The Lewis structure C is not a contributor (refer to resonance rules). Therefore, the average of two structures (A and B) indicates the electron delocalization between the two C-O bonds involving three atoms, shown as a resonance hybrid.
Therefore, the resonance hybrid gives one complete picture showing the delocalized electrons over a series of bonds.

The molecules that can be expressed with canonical structures and a resonance hybrid are said to show Resonance.
The molecules that show resonance have extra stability measured by resonance energy.
This is an excerpt from CurlyArrows' Introduction to Organic Chemistry Premium Tutorials, Chapter Electronic Displacements in a Covalent Bond.