When you attack a hoglin, the attacked hoglin will remain passive if within a 7 block radius of a repellent block such as Warped Fungus or a Respawn anchor.
However, any other previously passive hoglins in the same area will become aggressive and attack the player even if the player is directly over the repellent block. The aggressive hoglin will oddly become passive if attacked by the player. However, this will aggravate the hoglin that was originally hit.
This creates a weird mechanic where you can "juggle" two hoglins by simultaneously aggravating/pacifying a pair of hoglins.
Furthermore, when an aggressive hoglin successfully deals damage to the player while in an area it would normally be passive, it will aggravate other hoglins in the passive area.
These mechanics obviously also aggravate hoglins outside the passive area, however, once they move into the passive area they will be pacified.
I believe that passive hoglins should remain passive if they witness an attack on another hoglin.