Compression is the process of running data through a mathematical algorithm, which results in data that contains exactly the same information, but ideally uses less data, i.e. results in a smaller file.
The key to any compression algorithm is that when decompressed, the original data is recovered, exactly.
Most often we compress data contained in files on our computers. A compression program, such as WinZip, 7-zip, gzip, WinRAR, and many others, reads the file to be compressed, runs the data it contains through the compression algorithm, and writes the result to a new, typically smaller, file.
A compression algorithm is that mathematical function, of which there are many; zip, rar, and gzip are three common examples. Any program that understands a specific algorithm can typically compress or decompress files interchangeably with other programs that understand the same algorithm. Many programs, 7-Zip being one good example, have the ability to understand several different compression algorithms.
Many compression programs, WinZip and similar being examples, double as file *archiving* programs. In addition to compressing files, these programs bundle multiple compressed files into a single output file, referred to as a compressed archive.
It’s worth noting that all compression algorithms have worst-case scenarios, where running data through the compression algorithm produces a result that is larger than the original. While possible, with most common algorithms it’s actually relatively rare.