Dogs are so much smarter than humans given the right circumstances. Try it some time, they know A LOT about social situations. Sometimes more than a human.
However, they have less cognitive ability. Their social understanding of mental hops is weaker than ours. They can understand this:
'I know that he know's where the bone is' Therefore, the dog follows the dog who knows where it is.
Us as humans, think more like, 'I know that he knows where the bone is, and that everyone around him knows he knows where the bone is. I can see the general direction he's taking towards the bone.' Where the dog, thought that only he knew, that this dog knew where the bone was.