I do not know the exact method, and there are multiple methods used anyway, but essentially the compressing tool will look for patterns of repeatable characters or sequence of bytes in a file. Once found it will compute a smaller coded sequence that represents that repeating of bytes and substitute that in its stead.
Because the result will typically have a jumble, and smaller set of bytes with no repeating byte pattern the end result will not compress much more. That is why you can't compress an already compressed file, using some other compressing tool to get further reduced results.
The un-compressing does the opposite. It looks for those special coded bytes and replaces with the original byte pattern.
I'm fairly new to programing and such but this has puzzeld me for quite a while. How does winzip compress files? I'd be very thankfull for some help.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic