Quicksort is a divide-and-conquer sorting algorithm that works as follows:
1) Partition the array around a pivot element into two subarrays such that all elements in one subarray are less than or equal to the pivot and all elements in the other subarray are greater than the pivot.
2) Recursively sort the two subarrays.
3) The entire array is now sorted.
The performance of quicksort depends heavily on how balanced the partition is - an imbalanced partition leads to worst-case quadratic time, while a balanced partition yields average-case linearithmic time.