In a new YouTube video that has gone viral, a dog is seen diving into water off the coast of Australia in pursuit of (and possibly biting) a lurking shark. In another video uploaded in 2006 that has since racked up over 27 million views, a dog jumps off a boat, bites into a shark and drags it to shore — possibly killing it.

What is going through these dogs' heads? Why would man's best friend go after the ocean's most feared predator?

We asked Niwako Ogata, a dog behavior researcher at the Cummings School of Veterinary Medicine at Tufts University. Because it's hard to tell what is happening below the surface of the water in the first video, Ogata focused on the second. [Watch the videos]

"It is difficult to say from this video if this dog had a particular interest in attacking sharks," Ogata told Life's Little Mysteries, a sister site to LiveScience. The dog might have been equally likely to go after any big fish or other object floating in the ocean, she said.

"Some dogs would react to any moving objects around them. We see similar behavior from a dog on a car ride," she said. A dog might try to jump out of a car to pursue a land creature, just as the dog in the second video jumps off the boat to pursue a shark. If the dog in the first video did indeed chase and bite the shark, it was probably driven by the same instincts.

It could be that the dogs in these videos particularly enjoy swimming, or that they have high prey drives — strong instincts to pursue potential prey. For dogs with high prey drives, the thrill of the chase doesn't necessarily lead to killing. "Attacking a moving object is not always necessarily [referred to] as an aggression," Ogata said.

This article was provided by Life's Little Mysteries, a sister site to LiveScience. Follow us on Twitter @llmysteries, then join us on Facebook. Follow Natalie Wolchover on Twitter @nattyover.