Years back, there was a very good book called something like The Data Compression Book by, IIRC, a Mark Nelson. Explained many compression schemes including *zip, with working code in C. I had it, read it early in my career, could understand parts of it. A testimonial to the book, not me.