He's using a bijection between the number on the left (which are ordered) and the UUID that's designed to produce something random-looking. The simple fact that bijection cannot produce the same output out of two inputs (or it's not a bijection) means that all the UUIDs are unique.
This site is specifically about “V4” UUIDs where the two dimensions are random and also-random. If you scroll all the way to the bottom you will see that the last table row is numbered the same value as the maximum 122-bit number, so the site is flipping every possible bit-combination within that space combined with the metadata bits that say “Hello I am a V4 UUID”:
irb> ::Array::new(122, 0b1).reduce { (_1 << 1) | _2 } => 5316911983139663491615228241121378303He's ensuring the uniqueness by indexing from 0, and applying the cipher to come up with a more "random" looking UUID.
[1] https://eieio.games/blog/writing-down-every-uuid/#toc:feiste...
A big part of this is that the possibility space is very large, so the chance of collisions is low. Many UUID versions also determine parts of the UUID via MAC addresses and timestamps, to ensure that different servers are highly unlikely to generate the same UUID.