There are two phrases for what I believe you're referring to: "ruminate" and "chew the cud."
Cows and goats are types of mammals known as "ruminants." From Wikipedia:
Ruminants are mammals that are able to acquire nutrients from plant-based food by fermenting it in a specialized stomach prior to digestion, principally through microbial actions. The process, which takes place in the front part of the digestion system and therefore is called foregut fermentation, typically requires the fermented ingesta (known as cud) to be regurgitated and chewed again. The process of rechewing the cud to further break down plant matter and stimulate digestion is called rumination. The word "ruminant" comes from the Latin ruminare, which means "to chew over again".
These animals are often chewing their cud (highlighted in bold), which might be why you're asking this question.
The OED defines "ruminate" as:
[3] a. intr. Of an animal: to chew the cud; to chew again food that has been partially digested in the rumen.
As you can see, "chew the cud" is included in that definition, but is less formal.
If you are specifically referring to these animals, either phrase could work. But be careful in other contexts if you aren't talking about a ruminant!
As pointed out in the comments, "ruminate" holds a different meaning for humans:
[1] a. To revolve, turn over repeatedly in the mind; to meditate deeply upon.
(From the same OED page)