It probably doesn't. It can't be always in focus, it must be set to infinity; stability is probably achieved with either image stabilization, being on smooth surfaces or both at the same time. Finally, it probably doesn't follow the pet, the user simply is able to rotate the camera; it would require a lot of effort to have a tracker for animal faces; maybe it could be using some sort of sound tracking, but it would be worthless with pets that do not emit sounds. The only task that the ball is capable of performing is keeping itself pointed upwards by using a counterweight on the bottom of the ball while rolling around. It moves just because it has 2 wheels under the sphere inside the shell.