The idea is that a burst of ultrasonic noise is unpleasant. The dog links the unpleasant experience to barking, and stops woofing. However, many dogs learn to ignore the unpleasantness and carry on barking anyway. Ultrasonic anti-barkers also tend not to work in older dogs, who have a more limited hearing range due to their age.