Although you can see the pencil, it appears broken in the glass of water. This is because

Aelectromagnetic waves cannot travel through solids.
Belectromagnetic waves travel at different speeds through different media.
Celectromagnetic waves compress more when they travel through denser media.
Delectromagnetic waves get closer together when they go through dense media like glass.

Verified Answer :

B, Refractive index of the water could be the key to this "optical illusion".
EM waves travel more slowly in any other medium other than a vacuum or air as the next best thing. And that gives rise to the idea of light "bending" and refractive index.

Answer:

B) electromagnetic waves travel at different speeds through different media.

Add me on snap : goldenbiys23