Here's how it works:
* Light travels at different speeds in different mediums. Light travels slower in water than in air.
* When light passes from one medium to another, it bends. This bending is called refraction.
* The angle of refraction depends on the angle at which the light strikes the surface and the difference in the speed of light in the two mediums.
When you look at a pebble at the bottom of the river, the light rays from the pebble travel through the water and then through the air before reaching your eyes. As the light passes from the water (slower medium) to the air (faster medium), it bends away from the normal (an imaginary line perpendicular to the surface).
This bending makes the light rays appear to be coming from a higher position than the actual pebble. Your brain interprets this information as the pebble being higher than it really is.
In short, the apparent "raised" position of the pebble is an optical illusion caused by the bending of light as it passes from water to air.