Light moves from water to air when you look at the section of the pencil that was immersed in water (or from water to glass to air). This light beam alters the medium and is subsequently refracted. As a consequence, the pencil picture looks to be shattered.
The "bent pencil" illusion is caused by refraction at the water/air contact and changes in optical density. The refraction creates a visible shift in the location of the pencil section within the water. Because of light ray refraction, a pencil appears bent in water. The brain automatically fills in the missing information so that no part of the pencil is seen behind the surface of the liquid.
Illusion of depth in the bent-pencil image occurs because light from distant objects reaches the eye later than light from near objects. Thus, when only one side of the pencil is immersed, it seems as if the whole pencil is deep in the water. As more of the other end of the pencil comes into view, however, its appearance changes to show that it is actually far away. This means that even though only one side of the pencil is submerged, we see it as deeper than it really is.
Furthermore, since light travels faster through glass than air, light from distant objects arrives on the opposite side of the pool before light from close-by objects. This is why scenes look three-dimensional when viewed through water; distant objects appear closer together than nearby objects. Also, shadows are created where lights are blocked from reaching the object being shaded. Finally, reflections change depending on what's above the water line so that an observer standing beside the pool will see different images in a mirror than another person standing farther away.
The Science of Pencil Bending When anything comes in the way of the light waves, it causes refraction. Because light does not travel as quickly in water as it does in air, it bends around the pencil, making it appear bent in the water. This is why when you put your hand into water that contains a pencil it will appear bent even though it is not.
Pencils are made up of two parts: the wood barrel and the lead tip. When light hits the top of the pencil, some of it is reflected back out to the eye. But most of it goes through both the wood and the lead and gets absorbed by these materials instead. The light wave inside the pencil becomes distorted as it travels through the wood and lead, just like any other wave. When it reaches the end of the pencil, it re-emerges from the other side as a new, distorted wave. This means that when you look at your hand in water you cannot see all the wrinkles and lines on it because they are being obscured by the pencil's refraction.
Reflection is when an incident light wave hits an object with a higher density of surface atoms than itself and then returns to its original source without being absorbed. That is, only the lower frequency wavefront component of the original beam is transmitted while the higher frequency wavefront component is reflected back towards its source.
Refraction happens when waves bend at an angle when they enter a new medium. The graphic below shows an example of refraction. When light travels from air to water, it bends. Because of the bending of the light, the pencil appears to be shattered. Refraction is what allows you to see across oceans or between floors in buildings.
Reflection is like looking into a mirror. It happens when light hits a surface with a flat side. The light bounces off that surface and continues on its way. Reflection is why we can see our own faces in a mirror. Mirrors don't affect the color of light; only certain types of material can do that. For example, silver filters out red light and lets blue and green light through. That's why photos taken at night look black and white; the camera is using silver filters to block out all the color.
Light waves are always moving; they are oscillations that spread out from their source particle. As these waves travel through different materials, they are affected by the properties of those materials. For example, light waves will be bent or changed in direction if they travel through a lens. This is why images are formed when light hits a piece of film or digital sensor; the waves are altered by reflection or refraction and this creates a pattern that tells us about the objects behind the screen.
Because light is refracted differently through oil than through water, the results are more striking when a glass is half filled with oil and half with water. That is why, as you slide the pencil through the glass and look at it from different angles, it appears to be dramatically fractured. The same thing happens with corn syrup - the lens of your eye focuses the image sharply in certain places and blurs it out in others.
However, because both oil and corn syrup are transparent, the pencil still looks exactly the same through them as it does otherwise.
If you put the oil or corn syrup into a bowl and rubbed it around the pencil, the effect would be much less dramatic, since more of its surface would be visible. But the pencil itself would still look exactly the same.
Light travels faster when it passes through something thick like sugar or water, so if you were able to freeze-frame two images of the pencil taken at slightly different times, you would find that some parts are completely black while other parts are still bright white. This is because some parts of the pencil blocked out all the light while other parts let some of it pass straight through.
It's also worth mentioning that although oil and corn syrup don't change the color of the pencil, they do change how it reflects light.