Some are pretending that they are hunting. These dogs will try to stop the bike, but they will do no harm. This dog was not attacking me, just the bike. Some dogs have been trained by the owner to chase and even attack. I have seen owners giving their dogs a signal to chase on some occasions.
Some dogs remember the last cyclist and are out for revenge.
And I'm sure I didn't cover every reason. Some dogs will bark, but will not make any move. Some will run along their property line but never get into the street. Some will run into your bike and try to knock you down. Some will lie in hiding and jump out in front of your front wheel.