Quicksort is a divide-and-conquer algorithm that works by partitioning an array around a pivot element and recursively sorting the subarrays. It has average-case performance of O(n log n) but worst-case performance of O(n^2) if the partitioning is badly unbalanced. Choosing the pivot randomly helps ensure close to average-case behavior. The key steps are partitioning the array around a pivot into elements less than or greater than the pivot, and then recursively sorting the two partitions.