The sun shines overhead, while the hum of insects and birdsong completes a beautiful day. On the other side of the park, your pet dog bounces around excitedly. Snuffling the ground, he suddenly stops to enthusiastically roll on the grass before bounding back to you. It is only when you bend to greet him that it hits you: a pungent, foul musky stench. Your dog has rolled in poo.

This is something most dog owners will have experienced during a walk. But why do domestic dogs seem to get such joy from smearing another animal's faeces on their coat?

"These are animals with a sense of smell that is said to be at least a thousand times more sensitive than our own," says Simon Gadbois, an expert in canid behaviour and scent processing at Dalhousie University in Halifax, Nova Scotia. "It seems unbelievable they would want to cover themselves in a smell that even to my nose is unbearable, yet they do."

Gadbois, who has studied wolves, coyotes and foxes in Canada, also uses domesticated dogs to help track animals in the wild. One of his prized sniffer dogs, a border collie called Zyla, would delight in rubbing herself in beaver excrement whenever they were working in the field.

"In case you have never smelt beaver poop before, it is horrible, really vile, and it stinks for weeks afterwards," says Gadbois. "It was always beyond me why she would do this. You would think it would interfere with her ability to smell and track other animals, but remarkably it did not affect her performance one bit."

Humans first domesticated dogs around 15,000 years ago, and we have lived side-by-side with them ever since. It is possible to find shelves-full of research on their behaviour, but there is surprisingly little that explores why dogs have such an affinity towards other animals' poo.

We asked BBC Earth readers if they could offer any insights into this baffling, and rather disgusting, canine habit. It seems your dogs will roll in just about anything, from fox and badger faeces to geese droppings and even dead fish.

The most common explanation put forward is that the behaviour is an evolutionary hangover from their days as wild predators. For example, Vesa Valenius and James Turner both suggest it was inherited from wolves, who roll in poo to hide their scent from prey as they close in for the kill.

It is certainly true that wolves will roll in the faeces of other species, and even in the carcasses of dead animals. But one of the few studies of this behaviour in wolves, published in 1986, threw up some perplexing results.

Biologists studied scent-rubbing in two groups of captive wolves in Canada by providing them with a range of different odours. Surprisingly, the wolves were least interested in rubbing themselves in the faeces of herbivores like sheep or horse: the scientists did not see them rub at all on these odours. Food was similarly unappealing. Instead, their favoured scents were artificial odours like perfume or motor oil.

For an animal seeking to disguise its scent from its prey, choosing to smell like something so alien to their natural environment is surprising to say the least.

However, the researchers also found that the wolves' second favourite scent was the faeces of other carnivores like cougars and black bears.

"I'm very doubtful that scent rolling is of much help in hunting," says Pat Goodmann, a senior animal curator at Wolf Park in Indiana who has spent several years studying scent-rolling in wolves. "Here at Wolf Park, the wolves are willing to roll in the scent of alien canids and domestic cats. It raises a strong possibility that wild wolves may roll in predator scent too. This would not be a helpful hunting disguise."

Goodmann also points out that, while wolves may occasionally hunt by ambush, they will more commonly chase their prey down, which does not require nearly as much stealth.

In fact, dogs smothering themselves in strong scents could have another similar purpose inherited from other wild relatives. Rather than hiding them from prey, it could help camouflage smaller canids from other predators.

Samantha Harrison was among those who suggested that scent-rolling it could be a form of camouflage.

The idea might be supported by research published in September 2016 by Max Allen, an ecologist at the University of Wisconsin at Madison. He captured some unusual behaviour by grey foxes on remote cameras set up around the Santa Cruz area of California. The normally reclusive grey foxes were regularly visiting sites that male mountain lions used for scent-marking. The footage showed the foxes rubbing their cheeks on ground that had been freshly marked with strong-smelling urine by the mountain lions.

Allen believes the foxes are using the odour left by these large feline predators as a form of odour camouflage, to hide them from other large predators like coyotes.

"Coyotes are so much bigger than grey foxes, but seem to want to eliminate them as there is competition for resources between them," says Allen. "The foxes cannot really fight back, so they are exploiting the puma scent to get some form of protection. Smelling like a puma might give them time to escape."

It is certainly an interesting idea. However, it does not explain why larger canids, like wolves, also rub themselves in the scent left by other predators.

Stephen Harris of the University of Bristol in the UK, who has studied red foxes, does not buy the idea that foxes use cat scents as camouflage. Instead, he suspects the animals might be trying to deposit their own scent, rather than pick some up.

"Foxes use their saliva as scent, and also have glands in the region of the lips known as the circumoral glands," says Harris. "We do not know the precise function of these scent glands, but you see foxes rubbing the sides of their mouths and necks on all sorts of objects. They often seem to do this in response to strong odours. Unusual smells seem to stimulate them."

Similarly, Pietr Maynard on Facebook told us he had assumed his dog was trying to cover other scents with its own, to "let other dogs understand they are ready to protect their territory".

However, pet dogs are rarely content with rubbing just their face and necks in the smelly muck they find: instead, they smear it right across their bodies. Philippa Baines told us how her dog Holly would stretch and squirm in cowpats, seemingly to rub the poo deep into her skin.

Goodmann has yet another explanation. She thinks it may be a way for wolves to carry information about where they have been to the rest of their pack.

Her late colleague and founder of Wolf Park, Erich Klinghammer, proposed that scent-rolling may be a way to tell other wolves about tasty treats they found while they were off on their own.

In her experiments, Goodmann found that wolves did not just eat if they found a large chunk of meat. "When presented with a side of elk, they both rolled and ate," she says. "I speculated that food scent on the wolf's breath and on its fur indicated that there were more leftovers to scavenge, for wolves that wanted to backtrack to the source of the odour."

This idea was echoed by Tine Howe on Facebook, who told us dogs roll in poo to carry the scent of prey animals home to the rest of the pack.

Hyenas have also been observed rolling in carrion, and receive more attention from other members of their pack afterwards. Similarly, a study of Ethiopian wolves showed they tended to roll on the ground following a meal, although they were also seen rolling in human excrement and on ground where humans had recently been.

This seems to point to a social function for the scent-rolling, but Gadbois believes it may have a more simple purpose. In the wolf packs he studied in Canada, the lead animal tended to be the first to roll in a strong scent, followed by the others.

"It could be that this is about establishing a group odour," he says. "In the wolves I studied, if one started rubbing in something like a deer carcass, the whole pack would follow and rub in it. I've seen this in coyotes and foxes in the wild, too. It seems to become the odour you share with all the others in the group."

This idea of sharing an odour to increase the sense of "togetherness" has also been seen in African wild dogs: females will roll in the urine of males from a group they are looking to join. Similarly, dogs in a pack will regularly rub against each other's scent glands to pick up each other's scent.

Of course, there are some even more outlandish ideas.

For instance, it has been suggested that dogs and their wild counterparts use strong smells as a sort of insect repellent, although using faeces as the scent of choice seems decidedly unsuited to this purpose. Others have suggested oils in the faeces might help waterproof their coats.

Alternatively, they may be using the pungent odours in much the same way as we humans use perfume, suggest Robert Reppy and Krystal Parks. This idea has also been put forward by animal behaviour specialist Michael Fox in his book Dog Body, Dog Mind. Fox suggests that a squirt of perfume might help discourage a dog from seeking out unpleasant odours.

Meanwhile, dog psychologist Stanley Coren believes it may be an attempt to obtain an extreme sensation. He suggests it is "an expression of the same misbegotten sense of aesthetics that causes human beings to wear overly loud and colourful Hawaiian shirts."

This hints at a suggestion put forward by readers like Frances Mahan on Facebook: that dogs simply get a kick out of rolling in poo.

Anyone who has watched their dog's gleeful reaction after rubbing themselves in something disgusting will understand.

"I suspect they get a great big rush of dopamine, a neurotransmitter involved in reward and pleasure," says Muriel Brasseur of the Oxford Animal Behaviour Centre. "If it is a behaviour from their evolutionary past that was linked to survival, it could be reinforced by being extremely good fun."

In other words, Gadbois says, the canid desire to rub in bad smells could be a relic from some ancestor long ago in their evolutionary past. "It may have had a very important function at some point a long time ago," he says. "Over time that function has vanished, but they still do it. It brings us back to the fact that we really have no idea. Odour is such an important part of their world and we really don't understand it."

None of this will be much consolation for dog owners whose pets choose to rub themselves in particularly pungent poo just before important guests arrive. It seems normal dog shampoo can do little to remove the stench, so some readers have turned to more unusual methods. Lynn Mee recommends massaging tomato ketchup into the offending area and then washing it off. We have not tested whether this works.

Finally, we will leave the last word on the topic to Kate Dumont. She has a simple explanation for why dogs roll in faeces: "because they are poo-ches."

Now that really does stink.