Resonance has a deeper significance in the mathematical formalism of valence bond theory (VB). Quantum mechanics requires that the wavefunction of a molecule obey its observed symmetry. If a single contributing structure does not achieve this, resonance is invoked.
For example, in benzene, valence bond theory begins with the two Kekulé structures which do not individually possess the sixfold symmetry of the real molecule. The theory constructs the actual wave function as a linear superposition of the wave functions representing the two structures. As both Kekulé structures have equal energy, they are equal contributors to the overall structure – the superposition is an equally weighted average, or a 1:1 linear combination of the two in the case of benzene. The symmetric combination gives the ground state, while the antisymmetric combination gives the first excited state, as shown.
In general, the superposition is written with undetermined coefficients, which are then variationally optimized to find the lowest possible energy for the given set of basis wave functions. When more contributing structures are included, the molecular wave function becomes more accurate and more excited states can be derived from different combinations of the contributing structures.