When using a Piglin or Hoglin Spawn Egg in a non-Nether dimension to spawn a Piglin or Hoglin, their retreat sounds play instead of their ambient sounds. It does not affect other spawn eggs since their corresponding mobs do not even have retreat sounds.