A dogs urine and feces is it's one ID. Other dogs can recognize each other through this smell. In addition to WenKroy's great answer, urinating, mostly in males, is also a way to mark territory. By smelling the urine a dog can realize he might be careful because he's entering another dog's territory.