I went ahead and ran some tests on this myself because I really wanted to know how exactly the mechanics appear to work.

Method: I tested in Act 1 Hell with my weapon unequipped so my pets would be out for the longest time and not just kill everything. I tested for every summoned creature that had an offensive ability. I used no runes for the abilities themselves, and only used passives that increase the health and defenses of the pets (so they wouldn't just fall over). I tested if they'd assist their summoner in killing a target by punching enemies in the face with my weapon uneqipped and seeing if their behavior changed. I tested if they'd assist their summoner if he got low health by letting a creature beat on me while the pet beat on something else and seeing if their behavior changed.

**Findings:**

**Gargantuan appears to:**

 - Attack the closest enemy, regardless if the enemy is attacking him.
 - Change targets only when an enemy becomes closer to him than the one
   he is hitting.
 - Not assist his summoner when the summoner is attacking a specific
   target.
 - Not assist his summoner when the summoner is being punched in the
   face.
 - Not change his behavior when the summoner becomes low on health.

**Zombie Dogs appear to:**

 - Attack the closest enemy, regardless if the enemy is attacking them.
 - Change targets only when an enemy becomes closer to them than the ones
   they are already hitting.
 - Not assist their summoner when the summoner is attacking a specific
   target.
 - Not assist their summoner when the summoner is being punched in the
   face.
 - Not change their behavior when the summoner becomes low on health.

**Corpse Spiders appear to:**

 - Attack the closest enemy to their point of summon (the place you
   throw them).
 - Change targets only when an enemy becomes closer to them than the one
   they are already hitting
 - Not assist their summoner when the summoner is attacking a specific
   target.
 - Not assist their summoner when the summoner is being punched in the
   face.
 - Not change their behavior when the summoner becomes low on health.

**Hex Ability's Fetish Shaman appears to:**

 - Polymorph the closest enemy to their point of summon (on top of the
   caster when the ability is used).
 - Polymorph the closest enemy that is not polymorphed already.
 - Not asisst their summoner when the summoner is being punched in the
   face.
 - Not change their behavior when the summoner becomes low on health.
 - Note: I did not test for assisting on attacking a specific target
   with the Fetish Shaman because he doesn't actually deal damage, and I didn't test if he changed targets because he doesn't actually attack stuff.

**Fetish Army appears to:**

 - Attack the closest enemy to their point of summon (around the caster
   when the ability is used).
 - Sporadically run away from targets and/or change targets in what appears
   to be a completely random manner.
 - Not assist their summoner when the summoner is attacking a specific
   target.
 - Not assist their summoner when the summoner is being punched in the
   face.
 - Not change their behavior when the summoner becomes low on health.

**General findings broken down:**

 - Persistent pets (Gargantuan and Zombie Dogs) appear to attack the
   closest enemy in a Screen + 1/2 range until nothing is left or they
   die.
 - Non-persistent pets (Corpse Spiders, Hex Ability's Fetish Shaman, and
   Fetish Army) appear to attack the closest enemy to their point of
   origin until nothing is left or their duration expires.
 - All pets appear to only change targets if another target becomes
   closer to them than the previous one. This is only not true when a)
   the closer enemy is already surrounded by pets,  b) the Fetish Army
   who will sometimes randomly change targets, or c) the Hex Ability's
   Fetish Shaman has already Hexed the target so targets the next
   closest.
 - No pets appear to assist their summoner in any way due to any
   specific condition. They won't help against the target he is
   attacking if it is different to the one they are, they will not
   assist the summoner when something is beating on the summoner, and
   they won't assist the summoner when the summoner becomes low on
   health. If they're already summoned they will specifically target the
   closest enemy to them. The only way to get them to assist on a
   specific target would be to summon them closest to that target.