I am sure that you have opened up someone’s .js or .css file and have found one looooooooong line of seeming gibberish.
This is “minifying”, also called “packing” or “compressed” (not to be confused with zipping or tarring a file).
Now, why would someone pack their code?
Well, the number one reason is to hide the source from prying eyes but, honestly, this is like using a twist-tie to lock your front door. Way too easy to override. Just see the above two links. Besides, the coder hiding their code probably learned a lot from dissecting others code. Seems a bit hypocritical, not to mention self-important. And you know what? It is a pain in the arse having to keep a packed and unpacked version and trying to keep them straight.
The second reason, which makes more sense, is to speed up parsing and execution. Does this work? No idea. You would really need some seriously controlled lab experiments to figure that out. Transfer speeds at home fluctuate way too much. There is no way that you could do a quantifiable test.