Look, this is the elephant in the room. If we're going to talk about strange dog behavior, and don't get the "they eat shit" thing off the table right away, we would be shouted down until we addressed it. And rightfully so.
Dogs eat their own poop, they eat other dogs poop, mother dogs eat the pups' poop (your mom never loved you enough to do that, did she?). They'd eat poop all day if you let them.
So What the Hell Are They Thinking?
Back when dogs were wild and roaming the plains instead of riding around inside of tiny purses, predators could find a dog's den by detecting the smell of poop, specifically the kind left by defenseless, tasty puppies. Puppy feces has a distinct smell (you puppy owners know this!) because of the high milk content, making it the shit equivalent of a Swiss delicacy. So, to clean up the evidence and keep predators away, mom would eat it. We don't know why she doesn't just bury it, but we're not here to judge.
Only imagine that stick is poop.
Anyway, this tradition carries on even for dogs that had been living in the comfort of human homes for generations. Tradition just works like that sometimes, you don't know why you and your buddies high-five when you're celebrating something, you just do it because that's what people do. You would think that at some point you'd reevaluate it if instead of slapping hands you were fucking eating your own shit. But again, they're dogs.