Also:

Sometimes, behavior problems form because of a medical or hormonal issue in an animal. Dogs that have UTI (urinary tract infection), for instance, may begin urinating in the house frequently, even if they were previously well potty trained. The second fear period, a stage in adolescence which is indicated by a heightened startle reflex, correlates with a surge in hormones in the “teenage” dog.

While the cause of these behaviors may initially be medical, hormonal, or related to a particular stage of development, sometimes the inappropriate urination sticks around long after the UTI has been treated, and the exaggerated startle response lasts long past adolescence and well into adulthood. These behaviors initially start out as the behavioral manifestation of a physical problem, but over time, they become learned behaviors.