Sharks actually attack dolphins on occasion, but sharks are wary of them because dolphins have excellent detection skills in the water, are highly intelligent, attack in groups and occasionally protect other mammals including humans even if they aren’t part of the dolphin’s pod. According to Sharks-World, sharks aren’t so much afraid of dolphins as they are confused by the sounds that dolphins make.
These sounds might irritate the shark, causing it to move away from the sounds. Dolphins use high-pitched whistling and clicking sounds in water in order to locate objects in a process known as echolocation. Smaller sharks especially might stay away from dolphins since they prefer to hunt prey smaller than them.
Some sharks, however, hunt dolphins. This is especially the case for larger sharks like the Great White. Dolphins protect themselves against sharks by coordinating in large groups and ramming the shark over and over until they are beaten to death. According to scientists like Michael Heithaus, sharks fear dolphins primarily when the shark is outnumbered. Since sharks usually hunt by themselves, and dolphins travel in large groups called pods, this is often the case. Sharks still attack lone dolphins, especially if they are older or sickly.