To compress a sound means to change it's dynamic.

For example: If you have a sound that, with the filter open, becomes terribly loud you can use a compressor with a fast attack time, a rather big ratio and a threshold set to the level where the sound shouldn't get any louder to keep it fitting in your mix, thats close to limiting than.

Or: If you want to make a sound more crisp, more slappy you use a slower attack time so that the first moment of the sound passes the compressor without change and only then the compressor starts to lower the volume of the release of the sound. For example a bass with a nice "click" in the the beginning or a snare drum. Adjust the compressor (in the insert) so that the "click" or the first hit of the snare passes the compressor. After 20-100ms the compressor should start to lower the volume of the bass or snare sound which will give you more space in your mix. You will still recognize the bass and the snare by it's attack, but their release will be more silent and this makes you mix more clean and crisp.

If you use synthesizers, a lot of that can be done with the envelope of the synth. A compressor is a tool mainly usefull to get control over natural sounds or to compensate things that you can't do with the envelope of a specific synthesizer.

Quality of compressor plugins differs heavily. URS, Waves and of course the DSP platforms like UAD have nice ones. Most analog hardware in my opinion easily sounds better than the average compressor plugin.