To reformulate the question, there is the following problem: given an array of numbers, find an index in the array that is a local maximum, meaning the value at that index $\ge$ the values at adjacent indices.
The algorithm suggested works as follows. Perform a binary search on the array. At each iteration choose a middle element of the array; examine its neighbors; if it is a local maximum or the binary search has narrowed down to just one item, output its index; otherwise recurse on a side with a greater neighbor. Clearly this algorithm runs in $O(\log n)$.
Your question is why this algorithm works.
The first observation is that every array has a local maximum. That is because an array of length 1 has a local maximum and if every array of length $n$ has a local maximum then given an array of length $n+1$, either its first element is a local maximum or each local maximum in the sub-array starting at the second element is a local maximum of the full array.
Now suppose there are two consecutive elements of the array $a, b$ and $a < b$. Every local maximum of the sub-array starting at $b$ is a local maximum of the full array and as shown in the previous paragraph, there must be at least one. Similarly if $a > b$, every local maximum of the sub-array ending at $a$ is a local maximum of the full array and there must be at least one. The algorithm always recurses to one of those mentioned sub-arrays and therefore when it gets to a single-element sub-array, whose only element is a local maximum of itself, that element is also a local maximum of the sub-array in the previous step, which must be a local maximum of the sub-array two steps prior, etc., all the way back to the full array.