Binary search finds a target in a sorted array by repeatedly halving the search space. You start with elements, check the middle, and discard half.
After one comparison, you have at most elements left. After two, at most . After comparisons, at most elements remain.
You stop when the range has element, so . That's why binary search runs in time.