Why transferred and size are different?

I’ve noticed on the network tab that Size and Transferred are different values.
Also, sometimes Transferred > Size but sometimes the opposite is true.

Is this because files compression? If it is so, how does it happen in a nutshell? Does the server compress and the browser de-compress files in the response lapse of time?

I’m quite confused here.