In her book Coaching People to Train Their Dogs, Terry Ryan identifies a number of reasons a dog might behave in a certain way. Let's look at those today.
Phylogenic behaviors are those that have developed over generations and therefore have evolutionary significance. These behaviors can be broken down into three main categories.
The first is food acquisition. This is a fixed series of behaviors that seems to be hard-wired in most dogs. The sequences goes like this: Search or find prey – stalk prey to get as close to it as possible – rush towards the prey – chase after the prey (because it likely took off when it saw the dog rushing) – bite/hold/shake/kill the prey – and dissect and eat the prey. This sequence can often be found in dog play, either with other dogs or with toys (which explains why so many dogs like to de-stuff their toys).
The second is hazard avoidance, in which the dog will avoid danger and/or seek safety and comfort, and the third is reproductive behaviors, for obvious reasons. Both of these will influence a dog's behavior quite a bit; testosterone often causes male dogs to mount, mate, and mark while estrogen and progesterone will cause a female dog to go into heat about twice a year for 20 days duration. During this time, the female's behavior towards a male will be quite... flirty.
Another reason dogs may do something is because it is an otogenic behavior. This is a fancy term for learned behaviors, although not necessarily trained behaviors. An otogenic behavior is one developed due to the influence of environmental factors. While a phylogenic behavior will be shared among all dogs, otogenic behaviors are specific to an individual.
Next, we have fixed action patterns (or instinctive motor patterns). These are patterns of behaviors that are triggered by something specific. The sequence needs to be completed before the dog will stop the pattern. The pattern is fixed, that is, it doesn't vary much (if at all) from time to time. That said, behavior modification can change a fixed action pattern. The food acquisition series I described above is a fixed action pattern.
A dog's temperament can also influence behavior. Temperament is a tricky thing, consisting of a mix of genes and environment, but a dog with a shy temperament will behave differently than one with a bold temperament.
Finally, we have instinctive drift, first discussed by the Brelands in their paper The Misbehavior of Organisms. Instinctive drift is what happens when an animal's innate behavior is so strong that overcomes a learned behavior, even when there is a reinforcer offered for the learned behavior.
Those are the reasons Terry Ryan identified as causes of behavior. Have you come across any others?