Humans will die to save their pets, and science can explain why

But loving your dog or cat is one thing; risking your life for them is another. So what makes humans do this, and where does this love come from?