You see a glass object because it both reflects and refracts light. When light traveling through air encounters a glass surface at an angle, some of the light reflects. The rest of the light keeps going, but it bends or refracts as it moves from the air to the glass.
When light passes from air into glass, it slows down. It’s this change in speed that causes the light to reflect and refract as it moves from one clear material (air) to another (glass). Every material has an index of refraction that is linked to the speed of light in the material. The higher a material’s index of refraction, the slower light travels in that material.
The smaller the difference in speed between two clear materials, the less reflection will occur at the boundary and the less refraction will occur for the transmitted light. If a transparent object is surrounded by another material that has the same index of refraction, then the speed of light will not change as it enters the object. No reflection and no refraction will take place, and the object will be invisible.
Wesson vegetable oil has nearly the same index of refraction (n) as Pyrex glass (n = 1.474). Different types of glass have different indices of refraction. In Wesson oil, Pyrex disappears, but other types of glass, such as crown glass or flint glass, remain visible. Fortunately for us, a great deal of laboratory glassware and home kitchen glassware is made from Pyrex glass.
For most Pyrex glass, the index-matching with Wesson oil is not perfect. That’s because Pyrex glass has internal strains that make its index of refraction vary at different places in the object. Even if you can match the index of refraction for one part of a Pyrex stirring rod, for example, the match will not be perfect for other parts of the rod. That’s why a ghostly image of the rod remains even with the best index matching.
The index of refraction of the oil (and of the glass, too) is a function of temperature. This demonstration will work better on some days than others.