A random pivot makes it unlikely to hit adversarial inputs that cause worst-case O(n²). In practice it gives good expected performance and avoids patterns like already-sorted arrays producing bad pivots.