Think of a PDF with heavy transparency effects. Like a logo with a drop shadow or an image with a soft fade. Those effects require complex math for your computer to display them. Flattening simplifies that math into a single pixel grid. Boom—the file shrinks because the math gets replaced by raw image data.
Another scenario: you have a scanned document with hidden layers—maybe OCR text sitting invisibly underneath. Flattening removes that hidden text layer. You lose the searchability, but you gain a smaller file. Yes, it's a trade-off. But often a worthy one for archiving a final version.
Side note: If you're flattening a simple text PDF with no layers or fancy effects—like a plain invoice—don't expect a huge change. You might even gain a tiny bit of size. Irony alert: sometimes flattening can make a file bigger if the original was super optimized as layers.