The sustain is most important because loudness perception comes froman integration (averaging) of the preceding 600-1000 ms to any given moment.
It transpires that the attack (first ~10 ms) is used mainly to form impressions of timbre, clarity, crispness and punch, while the sustain contributes most to the perception ofloudness. How can reducing the amplitude peaks make the sound seem louder? To understand this we need to consider the way our hearing interprets thestart (attack) and body (sustain) portion of sounds. The art of setting a compressor is mainly in fine-tuning themagnitude, speed and timing of the automated gain changes so that the compression process does not introduce artifacts. When the input signal exceeds a predetermined threshold the rate of increase is slowed (or even stopped) beyond that point.
Compression is a form of automated gain control that reduces thedynamic range of sounds.