Resonance is a mental approach used by chemists to visualize the structure of a molecule and overcome the inadequacy of bond-line structures.
When we use the bond-line structure we implicitly assume that the bonding electrons are present in the space where the bond is drawn. However, this is not always a correct assumption. Going back to MO theory, we learned that after bonding, the individual atomic orbitals cease to exist and new molecular orbitals are formed that represent the orbitals of the entire molecule. Extending this approach, we now understand that electrons are not necessarily present only between the bond lines. This mental approach of trying to visualize the various distributions of electrons in the molecule is called resonance. The distributions are called resonance structures and it mainly occurs when electrons travel through close pi systems creating resonance.