In case you want to learn more about compression, I recommend starting with this Wikipedia article: