Dogs are incredibly picky about certain aspects of their life. We've covered how your dog decides where to poop. What about peeing?
How Do Dogs Decide Where To Pee?
Your dog's peeing decisions share some commonalities with her pooping decisions. In both cases, when a dog is relieving herself, she is depositing valuable information in the form of scent marking. Dogs deposit their odor via their urine or feces, and another dog can glean tons of information from just one sniff, thanks to their amazing sense of smell.
From your dog's waste (be it liquid or solid), another dog can determine lots of different things, including how many dogs have been by this spot and whether there's a female in heat nearby.
The behavior of scent marking also serves to mark a dog's territory. Domestic dogs, obviously, don't really do a lot with this information, and it may seem a little silly to us that they insist on designating the corner patch of grass "their territory." However, the fact that this behavior may be useless in their current setting isn't what's on your dog's mind. They're acting on age-old instincts, passed down from their ancestors for whom territory designation was important.
The Last Word
What is your dog looking for when he searches for a spot to leave his mark? You may notice that your dog is especially drawn to areas that other dogs have clearly peed on, like trees or fire hydrants. This is so your dog can communicate "I was the last dog here" to the other dogs of the neighborhood. It is very important to them that all other dogs be kept up to speed on their whereabouts. What do domestic dogs do with this information? Not a lot, most likely, but their instinct to communicate via scent marking remains strong.
If you have a yard, you can train your dog to go to the bathroom in one spot. Peeing on walks around the neighborhood, however, is a different story. Your dog is picking up on scent cues from countless other dogs.