Dr. Roylott is a collector of exotic animals which he imports from India, where he had lived and practiced medicine for many years. He allows a cheetah and a baboon to roam the grounds of Stoke Moran. Holmes and Watson see the baboon when they go to the manor house at night to sit in Helen's bedroom. They do not see the cheetah, but Watson writes:
There was a cheetah, too; perhaps we might find it upon our shoulders at any moment.
The author's obvious purpose in introducing these dangerous animals into the story is to make it appear highly unlikely that whoever was responsible for the death of Julia and might be plotting to kill Helen is not some outsider, because the people who live in the area know about the cheetah and the baboon and are afraid to go near the manor. As Helen tells Sherlock Holmes during their initial meeting:
He has a passion also for Indian animals, which are sent over to him by a correspondent, and he has at this moment a cheetah and a baboon, which wander freely over his grounds and are feared by the villagers almost as much as their master.
Doyle is also trying to add some emotion to his story, which could otherwise turn into a simple puzzle of how a woman had been killed two years before in a locked room. The author has the fiery and notoriously violent Dr. Roylott put in an appearance at Baker Street right after Helen leaves. This too is intended to foreshadow violence and even death. When Holmes asks Watson to accompany him down to Stoke Moran, he tells his friend:
"I should be very much obliged if you would slip your revolver into your pocket."
This further suggests dramatic conflict and extreme danger. The only real violence that occurs is when the snake is driven back into Roylott's bedroom and kills him. But the reader will remember it as a scary story.