Answer:
This is due to bending of light ray passing through the medium.
Step-by-step explanation:
This can be explained using the concept of refraction.
Refraction can be defined as the bending of light ray as it travels from one medium to another (it can be from the less dense to denser medium or denser to less dense medium)
For that of pencil in water, light ray travels from less dense medium(surrounding air) to denser medium(water). This causes the pencil to bend away from the normal rather than towards the normal (angle of refraction being greater than angle of incidence) and hence the reason for the bending.
NB: Normal line is perpendicular to the plane between the medium.