You probably know how it feels to be in pain. But have you ever wondered how a dog or cat feels pain? Or a fish? An octopus?

In a new TED-Ed video, evolutionary biologist Robyn J. Crook provided some insight into what we know about this issue. Of course, we can’t ever know for sure, since we can’t (yet) read animals’ minds. But there are some things we can infer from the science of pain.

“It’s important that we find out,” Crook argued. “We keep animals as pets. They enrich our environment. We farm many species for food. And we use them in experiments to advance science and human health. Animals are clearly important to us. So it’s equally important that we avoid causing them unnecessary pain.”

Crook began by explaining that there are essentially two kinds of reaction to pain.

“In the first, nerves in the skin sense something harmful, and communicate that information to the spinal cord,” Crook explained. “There, motor neurons activate movements that make us rapidly jerk away from the threat. This is the physical recognition of harm — called ‘nociception.’ And nearly all animals, even those with very simple nervous systems, experience it.”

This serves an obvious evolutionary purpose: It lets animals, including people, know when there is a threat, so they can get away quickly.

“The second part is the conscious recognition of harm,” Crook said. “In humans, this occurs when the sensory neurons in our skin make a second round of connections via the spinal cord to the brain. There, millions of neurons in multiple regions create the sensations of pain. For us, this is a very complex experience — associated with emotions like fear, panic, and stress, which we can communicate to others.”

But what about animals? With them, we can only really know what we’ve observed — but it sure does seem like some animals have a conscious awareness of pain. In the wild, hurt animals nurse their wounds, make noises to show distress, and even become reclusive. In the lab, researchers found that animals, like chickens and rats, self-administer pain relievers (from special machines set up for tests) when they’re hurting. And in general, animals tend to avoid situations in which they’ve been hurt before — indicating a memory and awareness of previous pain and threats.

Most of this, however, is only certain to apply to vertebrates — the kinds of animals we can most relate to, like dogs, cats, bears, and alligators. Thanks to this, laws around the world frequently prohibit knowingly and unnecessarily harming vertebrates.

Still, there’s a good case that at least some invertebrates feel pain. Even invertebrates with simple nervous systems, like oysters, likely feel pain through nociception — since they recoil when hurt.

But those with more complicated nervous systems probably feel a deeper kind of pain too. For example, octopuses, which are invertebrates and among the smarter animals on Earth, do curl up an injured arm to protect it, but they’ll still use it to catch prey if they need to. “That suggests that these animals make value judgments around sensory input instead of just reacting reflexively to harm,” Crook said.

Yet in many places around the world, people continue to eat live octopus. And other more complicated invertebrates, like lobsters and crabs, are often boiled alive, even though we’re not sure how they feel pain.

“We still have a lot to learn about animal pain,” Crook concluded. “As our knowledge grows, it may one day allow us to live in a world where we don’t cause pain needlessly.”

Watch: The best cat videos come from the wild