A compressor is an effect that takes your core guitar tone and adds harmonic content, sustain and levels out your quietest moments so that your nuances can be heard. If used right, it won't affect your dynamics in any way but it will make you feel like you're playing through a maxed out tube amp (without the signal going into overdrive/distortion).
I have 3 compressor pedals, each one is very different, has its own strengths and weaknesses. So a good compressor isn't just a 'good compressor'. There are many types and even the same type can be very unique from one another.