The vet I heard it from said that it makes the dog wonder if it exists. It was a joke, but still my preferred explanation. Unless it's a male dog with testes intact. Then the whiff of a bitch in heat can seemingly bestow superpowers to do anything to get to her! No barrier can prevent a horny dog from escaping.