Mental Model
A peak element is one that is bigger than its neighbors. We use binary search to quickly find such an element by checking the middle and deciding which side to search next.
Analogy: Imagine climbing a mountain range where you can only see the peak by looking at your current position and its neighbors. If the right neighbor is higher, you walk right; if the left neighbor is higher, you walk left. Eventually, you reach a peak.
Index: 0 1 2 3 4 5 6
Value: 1 -> 3 -> 20 -> 4 -> 1 -> 0 -> 5
↑
mid pointer