Glass of water in glass of oil…?

Scenario 1:
A small glass is filled with water.
A large glass is filled with oil.
The small glass is placed inside the large glass.
A pencil is placed inside the small glass.

Scenario 2:
A small glass is filled with oil.
A large glass is filled with water.
The small glass is placed inside the large glass.
A pencil is placed inside the small glass.

Why is the pencil more visible in the small glass (filled with oil) and the large glass (filled with water)?

Explain, si vous plait.