Its effect is greatest if it is done before one year of age. Male dogs can sense females in heat through pheromones. These are airborne chemical attractants that are liberated from the female when she is cycling. They travel through the air for great distances. We grew up on a farm where the next closest house was over a mile away but when one of our female dogs was in heat, the males would come for miles from upwind, downwind, and crosswind.
Pheromones are, to say the least, very effective stimuli.
The problem with this reasoning was that many of us keep our dogs restricted in our homes, a kennel, or on a chain. Now think of the psychological stress the vasectomized male is under when he is locked up but yet smells that female in heat four blocks away. There is no joy of sex as he is trapped on your property unable to go and mate with her. He is, in effect, teased continuously for three to fourteen days while the female is in estrus and he is unable to mate with her. If dogs are neutered at an early age, they will not sense or respond to pheromones, and would certainly be less stressed and tend to stay home.