Without skip: when the two pointers land on duplicate values after a match, they emit the same triplet again. The set silently drops it, but the CPU still did the work.
With skip: after a match, we walk L past any equal neighbors (look-ahead: nums[L] == nums[L+1]) and walk R past its equal neighbors (look-behind: nums[R] == nums[R-1]). Then we advance both into fresh territory.
Net effect: no duplicate triplet is ever even reached. No set needed. Result is deterministic in order.