Pain is a primary driver of behavioral change. A cat that suddenly starts urinating outside the litter box is not being "vengeful"; it may be suffering from feline idiopathic cystitis (FIC), where the act of urination causes burning pain, leading the cat to associate the box with discomfort. Similarly, a dog that growls when touched on the back may not be aggressive by nature, but rather suffering from intervertebral disc disease (IVDD) or arthritis.
A systematic approach: rule out medical causes before diagnosing a primary behavioral disorder. For example, sudden onset aggression in an older dog should trigger a workup for pain, neoplasia, or metabolic disease.