If you ask: How can you say this when it is authentically reported from the Prophet ﷺ that “a man was driving a cow while riding upon it. It turned to him and said, ‘We were not created for this’”? (1) This indicates that it is not permissible to use them for something for which they are not customarily used.
The answer is that Allah’s saying, “And He created the livestock for you; in them is warmth and other benefits, and from them you eat,” [al-Nahl], and His saying, “He is the One Who created for you all that is on the earth,” together indicate that we may benefit from them in every manner of benefit. What is mentioned in this hadith is to be understood as referring to a cow for whom being ridden was burdensome; since it caused her hardship and was not customary, she said this.
Some scholars said that these animals may only be used for that for which they were created—that is, for the uses to which they are customarily put.
Question: Is it permissible to conduct experiments on these animals involving medicinal compounds or other medicines? Yes, because they were created for us. If this serves our interests and we do not intend to inflict suffering, then there is no harm in it. For this reason, we subject them to the greatest suffering by slaughtering them for food; yet the benefit to the Muslim community in knowing the effects produced by these compounds and the like is greater than the benefit of eating. In such a case, however, the means that causes them the least suffering must be used.
His statement, “nor milk from her that which harms her young,” means that “harms” refers to reducing its nourishment, such that it is not adequately nourished.
His statement, “nor milk,” is a clause that may indicate dislike and may indicate