system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do zip files compress information and file sizes while still containing all the information?
gpt
Image if you had a long paragraph and then try to find all the repeated word or phrases. For each repeated word or phrase, you replace the word or phrase with a lookup. Then you only need to write the repeated word or phrase once and from then on every spot you would write the shorter lookup. This is how files are zipped. 



Example

1 - word or phrase

2 - repeated 

3 - lookup

4 - you

5 - then

6 - write

7 - and

8 - the

Image if 4 had a long paragraph 7 5 try to find all 8 2 1s. For each 2 1, 4 replace 8 1 with a 3. Then 4 only need to 6 8 2 1 once 7 from 5 on every spot 4 would 6 8 shorter 3. This is how files are zipped.