Quicksort is a divide and conquer algorithm that works by picking an element as a pivot and partitioning the array around it. It recursively sorts elements before and after the pivot. The average runtime is O(n log n) but it can be O(n^2) in the worst case if the pivot selection is poor. The algorithm involves picking a pivot element, partitioning the array around it, and then recursively sorting the subarrays.