(a) Refraction — the change in direction of light when it passes from one transparent medium into another. It occurs at the surface of the water, the boundary between water and air.
(b) Light leaving the submerged part of the pencil has to cross the water-air boundary to reach the eye, and it changes direction as it does so.
The eye and brain, however, have no way of knowing that. They assume light has travelled in a straight line all the way, and trace each ray straight back along the direction it was travelling when it arrived. Those backward straight lines meet at a point that is not where the pencil actually is — it is shifted and raised.
So what has changed is not the pencil but the apparent position of its submerged part. The break is real as an observation and entirely an illusion as an object.
(c) Going from water into air, a ray bends away from the normal.
Water is optically denser than air, so light travels more slowly in it:
v=ncnwater=1.33,nair=1.00
On leaving the water the light speeds up, and a ray that speeds up on crossing a boundary bends away from the normal. Going the other way — air into water — it slows down and bends towards the normal.
Looking straight down the pencil, you would see no break at all. A ray travelling along the normal strikes the surface at 0°, and at normal incidence there is no bending — the ray crosses straight through. It still changes speed; it simply has no direction to change. The illusion depends entirely on looking at an angle.