The causes of trembling in dogs is remarkably similar to the causes of human trembling. It's more difficult to know what underlies the causes. For example, if we are fearful, why exactly does it cause trembling? There are a number of plausible answers. What is better understood are the conditions present when dogs tremble. These conditions are consistent enough that it's clear they cause the trembling.
Like humans, dogs tremble when they are cold. This is a physiological response by many mammals. Shivering increases circulation and maintains core body temperature. Literally, trembling helps keep dogs from freezing or becoming hypothermic. Trembling in response to cold is not volitional; it's a parasympathetic response or one the dog does without intending to.
Also like humans, some dogs tremble when they are afraid. It's a little more difficult to understand the link between fear and trembling. Fear invokes a dogs limbic system -- the response of either fight or flight. Trembling does not seem to help a dog do either. It may be an anxiety response from uncertainty.
While fear is a kind of excitement, it's an unpleasant kind. However, it has some things in common with exuberance: excess energy. It's not fully understood why some dogs tremble simply because they are excited. It may be that some dogs use the trembling mechanism to release excess energy.
Dogs are reluctant to exhibit pain. This is probably a vestige of their wolf heritage. In the wild, displaying an injury can mean death. Because dogs don't want to display injuries and they cannot tell us they are in pain with words, at some point they may shake. It may be to communicate their pain to us. It may be because their pain threshold has been surpassed and they can't help but shake.
As with pain, a dog might shake because of the discomfort of illness. Though some illnesses directly cause shaking, not just the discomfort that causes trembling. Like humans, some dogs have illnesses that cause palsy-like tremors. This is more common in small dog breeds. Some dogs suffer from epilepsy. And, for example, small white dogs are more prone to suffering from Shaker syndrome, a congenital tremor disorder.