When the vibrating fork is brought near the tube D, the adjacent tubes C,B and D are set to vibration and sound is transmitted through those vibrations.
In this case, we can observe that a loud sound is heard with the tube B and a low sound is heard as tubes A and C. This is because the resonance occurs with the air column in tube B whereas no resonance occurs in air column of tubes A and C. The frequency of vibrations of air column in tube B is same as the frequency of vibrations of air column in tube D because the length of air column in tube D is 20 - 18 = 2 cm and that in tube B is 20 - 14 = 6 cm (i.e., three). On the other hand, the frequency of vibrations of air column A and C is not equal to the frequency vibrations of air column in tube B.
Resonance is the tendency of a system to oscillate with greater amplitude at some frequencies than at others. Frequencies at which the response amplitude is a relative maximum are known as the system's resonant frequencies, or resonance frequencies. At these frequencies, even small periodic driving forces can produce large amplitude oscillations, because the system stores vibrational energy.
Resonance occurs when a system is able to store and easily transfer energy between two or more different storage modes (such as kinetic energy and potential energy in the case of a pendulum). However, there are some losses from cycle to cycle, called damping. When damping is small, the resonant frequency is approximately equal to the natural frequency of the system, which is a frequency of unforced vibrations.