A pencil placed in water appears to be bent because of refraction of light. The refraction causes an apparent shift in the position of the part of the pencil within the water.
If water is replaced by another liquid which is optically more dense than water, then the bending of the pencil will increase. This is because the optically denser medium will cause more refraction of light rays.