Since the latter three are supposed to follow the player, their pathing AI is especially complex. However, as with any AI, it is still imperfect, seen especially in areas with sophisticated terrain such as Arcane Sanctuary, which has lots of platforms with impossible geometric shapes. Therefore, most of the time, any non-player entity trying to follow a player will easily get stuck.
To prevent it, all player companions have the innate ability to teleport to their master if they venture too far and may not reach them by normal means.
Pathing AI may be used for the player's advantage: in a complex terrain, characters may use it to block monsters, and attack them from distance while they are searching for walkaround. This is helpful in areas like Pandemonium Fortress.
Ranged attackers have different AI from melee ones: as they do not need to come close to the enemy, they are still dangerous even if stuck.
In Diablo III, AI is also altered for monsters having Fire Chains or Molten affix: they will try to approach and surround players, even if they are ranged attackers.
Due to most monsters and pets blocking path of each other, with large number of allies, one can barricade the narrow passages, not allowing enemies to come close and forcing them to deal with tanking pets. However, this may backfire if one is unable to retreat due to their own pets.