There is a series of Pali suttas starting with Samyutta Nikaya 56.102 that state an 'animal' can be 'reborn' as a 'human' by realising the Four Noble Truths. The impression here is 'animal' refers to people with certain kinds of habitual (shameless & immoral) behaviours (rather than four legged animals), such as in the Buddhist story of the reformed mass-murderer Angulimala or as described in the Lokapala Sutta.
The behaviour of biological animals is largely programmed by biology. The Pali scriptures explain taught 'karma is intention' expressed by various 'actions of body, speech & mind'.
"Intention, I tell you, is kamma. Intending, one does kamma by way of body, speech, & intellect."
1. Mind precedes all mental states. Mind is their chief; they are all mind-wrought. If with an impure mind a person speaks or acts suffering
follows him like the wheel that follows the foot of the ox.
2. Mind precedes all mental states. Mind is their chief; they are all mind-wrought. If with a pure mind a person speaks or acts happiness
follows him like his never-departing shadow.
It is unlikely the behaviour of animals falls under the laws of kamma, which appear to be about the behaviour of people.
Animals for the most part kill only to eat & have sex only for reproduction thus are generally 'moral'. Where as people create kamma based on greed, hatred & delusion. For example, many animals give birth &, soon after, expel their offspring from their presence. Whereas most humans cling to their offspring & families for their entire lives, which results in a kind of suffering from 'death' that animals do not experience.