Heap sort is a sorting algorithm that uses a heap data structure. It first transforms the input array into a max heap by calling the heapify procedure. It then repeatedly swaps the root element with the last element, reduces the size of the heap by 1, and calls heapify to restore the heap property. This process continues until the entire array is sorted. Heap sort has a time complexity of O(n log n) and space complexity of O(1), making it efficient for sorting large datasets.