File compression uses software algorithms to reduce file size by reducing the bit-rate of a file. Lossy compression takes it a bit further and lowers the quality of thr file to make it even smaller.
Lossy compression is commonly used for media files, but would not be appropriate for other types of files.