If we use gzip to compress a calculus textbook does that mean that gzip understands calculus?

Finding repetitions and acting accordingly on them could be considered a very basic form of understanding.

To a small degree, yes. GZIP knows that some patterns are more common in text than others - that understanding allows it to compress the data.

But that's a poor example of what I'm trying to convey. Instead consider plotting the course of celestial bodies. If you don't understand, you must record all the individual positions. But if you do, say, understand gravity, a whole new level of compression is possible.