Compression is declared per stream, not per file
The unit of compression in a PDF is the stream: a run of raw bytes attached to a dictionary that describes it. A page’s drawing instructions are a stream. Each embedded image is a stream. Each embedded font program is a stream. So is an ICC colour profile, an attached file, and the XMP metadata packet. Every one of those dictionaries may carry a /Filter entry naming the decoding filter a reader must apply before the bytes make sense.
Because the declaration is per stream, a single PDF routinely mixes several compression schemes at once. The text of page four might be deflated, the photograph on it stored as JPEG data, the scanned signature beside it stored as a bilevel image under an entirely different filter, and the embedded font compressed with a fourth. There is no global setting that governs all of them, which is why two files that look identical on screen can differ wildly in size: they made different per-stream choices.
Filters can also be chained. A dictionary may list an array of filters, applied in order, most commonly when a stream is deflated and then encoded into a text-safe representation for transport. The important consequence for anyone trying to shrink a document is that the question is never "how compressed is this PDF" but "which streams are large, and what filter is each of them using".