If you want to observe a specimen under the microscope, then you have to add a mounting medium. The mounting medium is important for several reasons. Of course it stabilizes and preserves the specimen. But at least equally important are the optical characteristics. The refractive index (RI) of the mounting medium can have a significant impact on the image quality. We first have to understand, that the specimen itself also has a certain refractive index. The differences between the refractive index of the specimen and the surrounding mounting medium now influences how the specimen appears under the microscope.
Large difference of RI
A large difference in refractive index results in strong refraction of light where the specimen and the mounting medium meet. As a consequence, some parts of the specimen appears darker and this can cover up some of the details and color of the specimen. One of the most extreme cases occurs, when the specimen is dry mounted (without mounting medium, only air). In this case there is a large difference between the refractive index between the specimen and the air. As a consequence, dark fringes appear around the specimen, where the specimen and the air meet. The first image below illustrates this case. The pollen grains are much darker on the edges. Air bubbles in water are another example. While both air and water are transparent, the air bubbles are quite well visible because of the dark ring around the bubble. In short, a large difference in RI causes artifacts as light is scattered and can not be picked up by the objective. In most cases, this scattering is considered bad as they cover up important details. On the other hand, it does increase contrast for difficult to see specimens.
Small differences in RI
Small differences in RI between specimen and mounting medium will result in reduced scattering of light and the natural colors of the specimen appear stronger. The specimen also will appear more transparent and brighter. For most cases, this is the preferred situation, but there are situations where this can be seen as a disadvantage. Specimens that generally lack color and are small will be more difficult to see (in brightfield). In these cases the refraction would be helpful in increasing the contrast. Bacteria are such a case. The are small, transparent and lack color. They become visible because the RI difference and the resulting refraction make them appear darker (even in brightfield). If there is absolutely no differnce in RI, then the specimen is only visible in bright field if it has color.
Adjusting diffraction with the condenser diaphragm
The condenser diaphragm of the microscope does not only control depth of field, but also has a significant impact on image contrast. The amount of scattering can be adjusted by opening and closing the condenser diaphragm. Closing the diaphragm will increase the contrast of the specimen to the background by making it darker than the background. If you want to observe colorless specimens, then it is necessary to close the diaphragm more to make them darker. If the specimen is already colored, then opening the condenser will allow the natural colors to appear more.
You can easily try this out. Place a small droplet of water on the slide, with cover glass, and have a look at the place where the water meets the air. Then open and close the condenser. The edges of the bubble will become wider and darker when you close the condenser diaphragm.
Phase contrast vs. bright field
When you have a bright field microscope then the RI difference between specimen and mounting medium should be small. The color contrast should be large, however. This allows you to open the conducer diaphragm to increase resolution.
Phase contrast microscopes depend on a difference of RI. The microscope converts differences in RI into brightness (but not only at the edges). Extreme phase contrast specimens have a RI difference but no color. In this case the specimen color does not interfere with the brightness difference created by the phase contrast optics.