This idea comes from Mechanical Philosophy, and is represented in the writings of Descartes. According to his dualist view of the world, the soul and body are opposed, but only humans have a soul.
He wanted to show that animals are just automata, and believed that they are incapable of feeling pain.