So when a dog urinates, it leaves a scent for other dogs and animals to detect.
When your dog drags it's feet in the grass and kicks feverishly after defecating, it is not only leaving a scent marker from it's feet pads, but also a visual marker that says "I was HERE!" Defecating works in a similar manner.