How postgres deals with XIDs and wraparounds?
Imagine the transaction IDs from 0 to 4294967296 in a circle. AS some point in that circle is your current transaction ID.

Let's say your current transaction ID is 1000000. Then the 2^31 transaction IDs after it are in the future: 1000001 to 2148483648. And the 2^31 transactions before that are the past: 2148483649 to 4294967296 and 0 to 999999 (remember we have a circle, so right after 4294967296 comes 0).

Once your current transaction ID crosses 4294967296, it becomes 0 again (to be precise, it will become 3, because the transaction IDs 0 to 2 have a special meaning).