Compares elements at the two ends of the current interval and swaps them if out of order, then moves both pointers inward until they meet, then recursively applies the same logic to each half. The outer loop repeats until a full pass produces no swaps.
Every comparison involves a pair of positions equidistant from the interval's centre, a mirror-image pattern that gives the algorithm its name. This symmetric structure allows multiple inversions to be resolved at once across the entire interval before diving into smaller sub-intervals, achieving O(n log² n) average performance.