There is a small opening on each side of the shark's head. This opening leads to the inner ear. Sharks happen to have very good hearing.
Their hearing is tuned to lower frequencies than a human's. And they can hear other fish struggling from many miles away.