The power of a dog's nose and their ability to discriminate between various odours is astonishing. Dogs are used in a wide variety of roles such as medical detection, detection of human remains under 7 metres of water and mud, raised cortisol levels in humans and in a wide variety of roles within our armed forces. A dog's smell can be 10,000 to 100,000 times stronger than ours depending on the breed. The odour-centric nature of our dogs affects how they interact with each other. They detect chemicals signals from each other using scent. This scent can be deposited in urine and their poo and by just having a good sniff at the back end of their canine friend! I often refer to a urine soaked post as a 'wee mail' left by the other dog!! This tells them everything they need to know about the other dog. The sex, the age and the health and breeding ability are pieces of information gained through your dog having a good sniff. If you look carefully you will see your dog nose targeting the areas of a dog's body where pheromones (social odours) are released such as ears, muzzle, paws and of course the back end. These activities by our dogs are highly valued and in fact are essential ways of them navigating life and developing their social etiquette. So this is why it is so important to allow your dog to meet and politely greet other dogs, but you don't have to allow them to meet all dogs. I suggest 1 dog in every 3 is a good measure and on the other times just keep walking. Letting dogs sniff each other helps prevent barking and lunging on lead behaviours which are a result of the frustration your dog feels at not been able to do this totally natural behaviour.
Dogs just like us are collecting information about who is around, and on many occasions deciding whether they should play with them or not!