zip, winace, rar, etc. are lossless compression schemes. What you put in and get out are the same, unlike mpeg and jpeg which is lossy since information is thrown away to reduce size. Lossless compression depends and the fact that most data is not totally random. The lower the entropy of the data the better the compression can posssibly be. These compression schemes use techniques to compress the data based on similar chunks occuring throughout the data. Most are based on some form of LZ.
If you want to start messing around with compression, you should probably start with simple algorithms like run length encoding (which fax machines use a form of) or Huffman coding. Reading up on some information theory and coding theory works might also be good.