The lateral line is responsible for alerting a shark to potential prey and predators.