In my experience, as well as in research publications, very young toddlers (2 yo) develop empathy skills. See the reference below as well as plenty of other papers using Google search for:
pubmed promoting empathy in toddlers. Early signs of empathy (even the sense of fairness!) can be detected in very young babies even earlier. At 18 months, the empathy skills I observe are rudimentary, inconsistent and directed mostly toward family members and caretakers - rarely pets. So your example is not surprising.
Empathy develops "naturally", but also can be taught, with various degrees of success. My personal method of choice to teach empathy at this age is by positive example showing the desired behavior and praising when I see it. After the child hurts someone (here, a cat), I rarely punish the child. Instead, I demonstrate the behavior I want to promote: I sit down to face my child at the eye level, pet the cat gently, and look at the child, saying "See: gently... gently... Good cat... We love the cat... We pet here gently". Every time the child behaves well with the cat, I praise her and hug the child, and say "I like it when you pet the cat gently".
The truly enlightened sense of empathy, with good understanding that every sentient creature likes to be free, and not pulled by its "tail", is exceedingly rare in adults - to say nothing about toddlers.
Huang, H., Su, Y., & Jin, J. (2016). Empathy-Related Responding in Chinese Toddlers: Factorial Structure and Cognitive Contributors. Infant and child development, 26(3), e1983. doi:10.1002/icd.1983
According to Hoffman's (1987) theoretical model of empathy development, the early years, especially the second year of life, are critical for empathy development. During the first 3 years, children become other‐oriented rather than self‐oriented when exposed to others' distress, and it seems that this transition takes place in the second year. Zahn‐Waxler and colleagues conducted significant longitudinal research that examined a variety of empathy‐related responses, and their studies also supported the idea that the second year is the most critical period for empathy development. They found that toddlers at this age are capable of displaying a variety of empathy‐related behaviours, and there are significant individual differences in the development of empathy.