Binary search is an algorithm that searches for a target value in a sorted array by repeatedly dividing the search interval in half. It begins with an interval covering the whole array and if the target value is less than the middle element, it narrows the interval to the lower half, otherwise it narrows to the upper half. It repeats this process until the target is found or the interval is empty. The time complexity is O(log n), with the best case when the target is at the middle index and worst case when the target does not exist in the array. Examples in C++, Java, and Python are provided.