My question seems like an elementary question, but it's really not.
Suppose I have one million cars in a line sorted in alphabetical order by license plate. I am standing at the top of the line with the car with license plate AAA111. I want to find the car with license plate ZZZ999. I could do binary search to find the car with license plate ZZZ999, but I'm still going to have to walk the distance of one million cars, not a distance on the order of $\log 10^6$.
So this is why I'm asking how or why did computer scientists come up with the idea that binary search takes $O(\log n)$ time?