Data compression is a fascinating topic if you ask me. If you’re curious about it, I suggest you to read these two pieces of nice writing: The Elegance of Deflate and Smaller and faster data compression with Zstandard.
The first gives you a deep-dive into the inner-workings of widely used Deflate algorithm and the second is a piece from Facebook’s dev blog introducing their new data compression algorithm Zstandard.
Start with the first one.