BPE chooses the pair with the largest count and merges it into a new token. A stated lexicographic tie-break makes the rule deterministic even when counts tie.
highlighted = computed this step
Merge the most frequent pair
The argmax pair is (u,g) with count 5. The tie-break is lexicographically smallest pair, though this round has a strict maximum.
argmax=(u,g),count=5
The new token
Merging (u,g) creates the token ug. The segmentations become h ug with frequency 3 and p ug with frequency 2.
(u,g)→ug
Summary
After one merge, the displayed corpus has changed. The next round counts adjacent pairs in that new segmentation.