The three phenomenon responsible for formation of rainbow are:
- Total internal reflection
First of all light enters the spherical water droplets. The value of refractive index depends inversely upon the wavelength of the radiation in the medium, thus white light is dispersed at this point only. Now, during rainbow formation, these rays are reflected by the surface of the bubbles (and not refracted) by a phenomenon called total internal reflection.
When these rays come out of the spherical drops they undergo refraction again (Here, criterion of reflection is not fulfilled) the rays are again dispersed (Like in a prism) because of different values of refractive index of each colour and finally form rainbow.
Because of these criteria, rainbow does not form always, as the criterion of total internal reflection may or may not be satisfied at all the times. Moreover, rainbow is formed by a very large number of drops, so the amount of water present is also important.
Hope it is clear!