Anal glands! Eeew.
At one point in the evolution of domestic dogs and cats these were the little stink flags that marked an animal’s territory. They had a function. Today, they are the source of our pets’ fascination with sniffing each others butts and the sole reason they insist on long disgusting pauses during a walk, to get a snoot full of another animal’s droppings. It’s not the poo; it’s the scent of the anal glands.