Original: Whatever the veracity of such reports, it is extremely rare that a shark will feed on a pilot fish, and smaller pilot fish are frequently observed swimming into sharks' mouths to clean away fragments of food from between their teeth.
Simplified: Pilot fish follow sharks because other animals which might eat the pilot fish will not come near a shark. In return, sharks do not eat pilot fish because pilot fish eat the parasites which feed off sharks.