Like their owners, dogs and cats start to feel more aches and pains in their joints as they age, so they may shy away from physical activity that aggravates their conditions. And just like their owners, older pets lose flexibility and put on excess weight as they avoid exercise -- causing the whole cycle to accelerate.
The situation is largely the same when a dog or cat undergoes surgery on their hips, elbows, knees and ankles. When it hurts to move their joints, they avoid activity -- which only causes them to lose even more range of motion.