Often times it is motion. If dogs are running loose, a child is running, a person is riding a bike or a rabbit is running, they're motivated by motion.
Dogs are more likely to bite when the person yells or screams.
This includes animals behind fences, in parked cars or tied to a leash. It's very tempting to want to pet them, especially if you know the animal, but stay away. It's your best means of preventing a bite. If you happen to be in a situation where a stray dog comes up to you, stand very still with your hands to your side and feet together. Be like a tree.