Shell sort uses a sequence of diminishing gaps to compare and sort elements. A common gap sequence starts with N/2, then N/4, N/8, and so on. Each successive gap is typically half the previous one, eventually reaching gap=1 which is equivalent to a final bubble sort pass.