Answer; Changes between quiet/loud volumes and soft/aggressive attacks with the plectrum. More to the point, whether you actually use any variation in this or how frequently you lift/drop the power of your attack.
In the 'Grunge' period of the 90's bands like Nirvana and Smashing Pumpkins used to play clean guitar verses with softer drums and soft voices. Then for the chorus they would step on the distortion pedals, crash the cymbals and scream down the mic. Not so common now.
If you want to create a wide dynamic range on your own without relying on a distortion pedal to take the volume up, you have to get creative with the plectrum. Take a lesson from the man with the golden voice; Radiohead's Thom Yorke
This is nothing to do with data compression like MP3 and ZIP files.
Dynamic Compressors (AKA Sustainers) are often used with clean and acoustic guitars so you can play a range of soft/loud and not accidentally overdrive your amp when you hit the strings aggressively. They work by putting a volume ceiling, known as the 'Threshold level' on your signal which when met, will limit the output from getting louder.
It's like moving away from the microphone as you sing louder; You still hear the characteristics of a harder attack on the strings, like the screamy voice sounds different from a quiet one, but the compressor controls the output volume for you. Pro singers don't work without one for just this purpose. Well the soundman at the mixer anyway, the X-Factor boy won't know what a compressor is. Nor do half the amature guitarists.
Another use of dynamic compression is that your strings can get more punch & Sustain when the threshold is very deep. This is what the distorted lead guitarist wants for their long-note solos, and the bassist for rock solid vibration & string thud.
←See where the peak has been trimmed off here at the -33db threshold? You can then turn up everything left in red afterwards by +33db and you have a very powerfull sound wave; now more like a rounded rod than a diagonal line.
It's like a 'clean' overdrive; turning up the overall volume but without any levels going through the ceiling.