Compression techniques are implemented by two algorithms . There is the compression algorithm that takes an input x and generates a representation xc that requires fewer bits, and there is a reconstruction algorithm that operates on the compressed representation xc to generate the reconstruction y.
The word algorithm comes from the name of an early 9th-century Arab mathematician, Al-Khwarizmi, who wrote a treatise entitled The Compendious Book on Calculation by al-jabr and al-muqabala, in which he explored (among other things) the solution of various linear and quadratic equations via rules or an “algorithm.” This approach became known as the method of Al-Khwarizmi. The name was changed to algoritni in Latin, from which we get the word algorithm. The name of the treatise also gave us the word algebra

Based on the requirements of reconstruction, data compression schemes can be divided into two broad classes: lossless compression schemes, in which y is identical to x, and lossy compression schemes, which generally provide much higher compression than lossless compression but allow y to be different from x
Lossless Compression:
Lossless compression techniques, as their name implies, involve no loss of information. If data have been losslessly compressed, the original data can be recovered exactly from the compressed data. Lossless compression is generally used for applications that cannot tolerate any difference between the original and reconstructed data.
Example:Text compression
Lossy Compression:
Lossy compression techniques involve some loss of information, and data that have been compressed using lossy techniques generally cannot be recovered or reconstructed exactly. In return for accepting this distortion in the reconstruction, we can generally obtain much higher compression ratios than is possible with lossless compression.
Example: Audio Compression