Understanding Prefix Compression for Integer Type Indexes

Hello everyone,

I wanted to understand how prefix compression works for integer data types in WiredTiger.
There is a packing done for integers which enables lexicographic comparison.
This is used during the prefix compression. How does the packing enable integers to be sorted lexicographically?