One merge step counts many pairs.
transcript
A merge step can count many pairs at once. It never checks the pairs one by one. How does it do that?
The left half is four, seven. The right half is two, eight. Both halves are already sorted.
Compare the fronts: four and two. Two is smaller, so it is taken first. It came from the right half.
Four and seven are still waiting on the left. Both are larger than two. Both came earlier in the list. So two inversions are found at once.
Add the number of values waiting on the left. Here that is two. No pair was checked one by one.
Every pair is inside a half, or across the halves. Pairs inside a half are counted one level down. Pairs across the halves are counted by the merge. So each pair is counted exactly once.
A hundred thousand values have nearly five billion pairs. Merge sort counts them in about one and a half million steps. That is about one and a half seconds.
Count while you merge. Full breakdown in the lecture.