How many people are you playing with? Just you and a singer? A full 48 piece swing band?
Appropriateness is the key:
Rhythmic jabs, stabs and hits appropriate to the song's pulse. Playing in the pocket.
Harmonic density appropriate to the tune's structure. When in doubt, less is more.
Volume levels appropriate to the song's relative intensity at any given time.
Playing in the register appropriate to comping. Playing too high will make you stand out but might get in the singer's or soloist's way. Playing too low and you just become part of the "muddle in the middle".
Playing fills appropriate to the singer's phrasing. Not every fill belongs to you. Some other members of the band might think that every fill belongs to them. How do you get a word in edgewise? Two band members playing fills simultaneously generally clashes big time.
For the novice, comping can be a huge mystery and much of their time is spent trial-and-error trying to balance between finding their own voice and blending in with the arrangement.
For the experienced musician comping becomes a reflex borne of many years of playing with others.
There is still plenty of room for variations (improvisatory comping), but becoming overly busy in the background while the singer is singing or another musician is soloing will not make you any friends.
Many younger musicians feel that they have to "prove" that they're good enough to be on stage and consequently throw notes around like confetti all the time.
A more mature musician KNOWS that s/he is good enough to be up there and will therefore concentrate on what the arrangement calls for (as opposed to their own ego trips).