Cattle, sheep, and goats are grouped together in the study of farm animals primarily because they are all ruminants. Ruminants are mammals with a specialized four-compartment stomach (rumen, reticulum, omasum, and abomasum) that allows them to digest cellulose-rich plant material through microbial fermentation. They also exhibit the characteristic behaviour of chewing the cud (regurgitating partially digested food for further mastication).
This shared digestive anatomy and physiology is the most important basis for their classification as a group because it determines their feeding management, nutritional requirements, and overall husbandry practices on the farm.
While these animals do eat grass, simply eating grass is not a distinctive enough criterion for classification - many non-ruminant animals also consume grass. Being viviparous (giving birth to live young) is true of cattle, sheep, and goats, but it is also true of virtually all mammals, so it does not distinguish this particular group. Describing them as work animals is inaccurate - sheep and goats are not typically used for draught or work purposes.
Exam tip: The defining feature of the ruminant group is the four-compartment stomach and cud-chewing behaviour, not simply what they eat or how they reproduce.