compression
Compression is writing the same document in fewer bytes, with nothing taken out of it.
In more detail
A file is one long run of letters and numbers, and a document repeats itself a great deal: the same word, the same colour, the same instruction, over and over. Compression writes each repetition once and leaves a note saying where it comes back, so the file says the same thing in less room.
Nothing is lost on the way. The program that opens the document puts every repetition back before a single mark is drawn, and what appears on the screen is what was written, to the dot. That is what tells it apart from making a photograph lighter, where detail really is thrown away and never comes back.
What it does on a real document
A one-page invoice holds a few hundred words, a logo and a table. Written out plainly it weighs something like sixty thousand bytes; compressed, fifteen thousand. A firm sending out thousands of invoices a month feels that on every mailbox it fills and every backup it pays for.
There is a second saving, and it is less visible. A document is made of thousands of small notes about itself: which page follows which, where each drawing is filed, what each colour is called. Those can be gathered into one block and compressed together instead of lying loose, which takes a large slice off a document rich in small parts.
Where it comes from, and why
The method a PDF leans on was published in 1996 and is the one a zip archive uses. It was picked for three reasons: anybody may use it without paying, it unfolds a page faster than a reader can notice, and it gives back exactly what went in.
Older versions of the format left a document's small notes in plain sight, so that a program could read them without unfolding anything first. Version 1.5, in 2003, allowed them to be packed as well. A file written the old way still opens: reading software knows both.