An index of refraction gives the speed limit for light in that material.
The higher the number, the more slowly light has to move. See picture.
So by the principle of least time, a beam of light starting out at the bottom of the green circle would travel straight through the glass lens no matter what--if it bent, it would just take longer to get there; no sense in that.
But consider the beam of light leaving the top of the green circle. Were the lens not there, it would take the *yellow* path I've drawn. But because it moves more slowly in the glass, there's a faster route to get to the same place. By the principle of least time, light will take that route.
I've *really* exaggerated what happens so you can see it clearly: the light beam goes up higher, so that it can cross the lens where it (the lens) is thinner. That means it has to travel a lot further, but it's worth it because it ends up spending less time in the slow, time-consuming part of its journey.
Imagine:
lens = downtown street with rush hour traffic
air = eight lane interstate with no one on it.
You'd rather go eight miles on the interstate than three miles on the gridlocked downtown street
OR
lens = muddy field after a rainy football game
air = nice, dry gymnasium
It's faster (and cleaner) to walk up the stairs to the gym, cut through, and spend less time on the field than it is to take a slightly shorter path all the way across the muddy field.
*That's* why the light takes a more circuitous route, and that's why it appears to be coming from higher up, that is, from a larger object than what's actually there. (We naturally assume that light travels in a straight line; that's why we say that something 'seems' bigger or smaller whenever some of it's light gets bent en route.)
Finally: replace the interstate with even smaller, even more crowded streets. Going downtown will take awhile, but trying to get around it will take even longer.
OR:
Replace the nice, dry gymnasium with a loud, crowded mall on Christmas Eve--wouldn't it be quicker just to cut across the field?
*That's* why the light doesn't take the higher-than-yellow route when you put the lens underwater. In fact, it takes a lower-than-yellow route, so that it's route includes slightly more traveling in the (now relatively fast) lens, and less time in the (relatively slow) water.
Is my reasoning transparent?
P