One general indication that an animal has already given birth is the fact that it produces milk. With the exclusion of goats, almost all animals produce milk only after giving birth or close to that time. Once the mother has given birth, it is usually the newborn animal that nurses from its mother. The animal can recognize its offspring based on scent and usually does not allow other animals to nurse from her. There are rare occurrences, however, when a newborn animal may nurse from other lactating animals.
Given these facts, if someone observes a calf nursing from a cow can he be certain that she has already given birth and that any subsequent offspring would not have the sanctity of a firstborn?
Rabban Shimon ben Gamliel says: In the case of one who buys a nursing female animal from a gentile, he does not need to be concerned that perhaps it was nursing the offspring of another animal. In the case of one who enters amid his flock and sees mothers that gave birth for the first time nursing and also mothers that gave birth not for the first time nursing, he does not need to be concerned that perhaps the offspring of this one came to the other or perhaps the offspring of the other came to this one to be nursed.
Rashi explains that it is clear that according to Rabban Shimon ben Gamliel the nursing animal is certainly the mother of the suckling animal, and we do not need to be concerned that there exists a minority of animals that will nurse the offspring of others.
An issue raised by the rishonim is whether the presence of milk in an animal is, in itself, an indication that the animal has given birth. Rabbeinu Tam suggests that since Rabban Shimon ben Gamliel only discusses cases where there is a suckling animal attached to the mother it implies that milk by itself would not be enough of an indication that the mother gave birth. The Ramban disagrees and rules that according to Rabban Shimon ben Gamliel we do not concern ourselves with the possibility that an animal may be lactating without having given birth. He argues that the cases in the Mishna are discussed in order to emphasize that even if we know that the animal was among the minority that give milk before giving birth, nevertheless, if there is an animal suckling from it we can be certain that the animal is her offspring.