it works like jpeg. the compressor looks for duplicate lines of code, then uses a smaller code to represent all those duplicates (this is the non-lossy part). then it looks for parts of code that looks similar, then replaces them with a smaller code to represent all the close-to-duplicates (this is the lossy part).
the more efficient a decompression technique is, the smaller the code is r needed to epresent the uncompressed code.