As more pets have leapt into our homes and snuck onto our laps, some of their less acceptable behaviours have become more evident. There's the constant barking and meowing that may keep entire neighbourhoods awake, as well as the digging of plants, leaping up with scratchy claws, biting of wires, and eager ingestion of other animals' faeces.

Where did such irritating habits come from in companion animals, whose behaviour is usually so well matched with human tastes that dogs have developed a specialised muscle in their eyes to make them cuter and cats have learnt to understand our facial movements?

Also Read | Tips to save your pets from heatwaves

There are two key things to consider when tracing the roots of any given behaviour: the wild species your pet originated from and its background of living with humans.

Take, for example, many dogs' excited welcomes, which include jumping up and attempting to kiss your face finally settling for whichever area of the body doesn't recoil quickly enough.

In reality, this feature is a classic wolf behaviour - a remnant from their predecessors’ tens of thousands of years ago – and is generally placed high among dogs' most unpleasant behaviours.

As pups, wolves frequently leap up and lick into the lips of other pack members after they return from a hunt to beg for food. "They would like to give a 'kiss' – or at least this is how people describe it," Zsofia Viranyi, an expert in comparative cognition at the University of Veterinary Medicine, Vienna, and co-founder and co-director of the Wolf Science Centre told BBC.

Adult wolves, like penguins in the Antarctic, will regurgitate up a half-digested meal for them to consume.

Also Read | Atlanta woman finds wild African cat on her bed after waking up

However, certain behaviours that were completely natural in our pets' wild forebears have been dramatically exaggerated.

Cats, like dogs, have coexisted with humans for millennia. According to genetic and archaeological data, they first encountered humans at least 6,500 years ago in the Fertile Crescent region of the Middle East, where the earliest agricultural settlements sprung up.

Initially, the cats hung about for the feast of rodents that grew near human settlements, but as time went on, they became more and more involved with people – and ended up as unlikely candidates for domestication.

They migrated from their homeland through human trade routes, first to Europe and then to Africa, where they were represented as cats in ancient Egyptian temples, pyramids, and hieroglyphs, and interbred with indigenous North African wildcats.

This leads us to a characteristic that some cat owners may consider an intrinsic part of their attractiveness, while others feel forced to Google "how can you get a cat to shut up?" at 3 a.m. Wildcats do meow, but only at their moms when they are kittens, which is fascinating. They don't usually make this noise as adults.

Also Read | Here is why your dog hates the 4th of July firecrackers

Domestic cats retain their meow throughout their lives, but not to communicate with other cats — just to communicate with their human companions. Scientists questioned human listeners to assess the pleasantness of domestic cat meows versus their wild counterparts in 2004 and discovered that the former is much more pleasant to hear than the latter. This implies that their "annoying" vocalisations are not just an adaptation to life in the company of people, but that they have also been mellowed by domestication.

Discovering where our pets' habits originate from might help us reframe them as what they are - interesting ghosts from the past, rather than personal annoyances.