I always just say that's how they check to see if the new dog is a boy or a girl
Also, I heard that it helps them know where the other dog has been, it tells them what the other dog has eaten, and it helps them identify if they "know" the other dog's scent from their walks (when they mark).