Principle of least time (Fermat’s principle)

Why does a slightly curved path take less time than a straight path?

Ants can move faster on flat stones than on rugged grass. Therefore, travel time is the shortest on slightly curved paths. This principle of the least time is fundamental in optics. Whenever light goes from one point to another, it follows a path that takes the least time.