An alternative etymology is that pilot fish were once, erroneously, thought to be piloting sharks to food, or even (as legends have it) piloting ships, whales and swimmers to safety.
The pilot fish's relationship with sharks is a mutualist one; the pilot fish gains protection from predators, while the shark gains freedom from parasites.