A dog's leg may shake because of nerve responses, according to MentalFloss.com. This is known as the "scratch reflex," occurring when an owner playfully rubs a dog's belly. The nerves register the touch as irritation, sparking an involuntary movement of the legs. It is an instant reflex to scratch itchy areas of the body.
MentalFloss.com also notes that it is a healthy reaction in dogs and a testing method veterinarians use to find out if the nervous system is healthy.
BigSiteOfAmazingFacts.com notes the various theories stemming from this biological reaction, such as scaring away predators, or to safeguard dogs against drowning.
A more serious reason can be traced to kidney disease, according to MyTCMVet.com. Kidney disease can cause low electrolyte levels and mineral deficiencies, resulting in muscle dysfunction. Adrenal problems can also be related to mineral and electrolyte imbalances. General muscle weakness can also stem from arthritis or any joint-related ailment.
VetStreet.com also touches on general muscle weakness, but adds fatigue as a possible cause. A dog's leg may shake after overexerting the limbs. Pain may also be a factor, particularly within the back or abdominal regions. Stress and general anxiety may also play a role, along with medications the animal may be taking.