Short answer
The Qur'an says that pure milk comes out from between the stomach's contents and the blood, and it calls this a sign (16:66). The verse was revealed to the Prophet Muhammad (ﷺ) in seventh-century Arabia. The best learning of that age said milk is blood, changed. Aristotle, and after him Galen, a Greek physician in Rome, taught that milk is cooked blood. The Qur'an does not say this. It calls the milk pure, something apart from both. We now know that food is broken down in the gut, and its nourishment passes into the blood. The blood carries it to the udder, where the gland's own cells make the milk. Nothing learned since contradicts the verse, and it did not repeat the error of its age. The verse is a sign, inviting us to think about the One who brings pure milk out from between the two.
Full explanation
What the verse says
The Qur'an calls milk a sign to learn from. It says the milk comes from between two things, farth and blood, and that it comes out pure. The Arabic farth means the contents of the animal's stomach. Two classical commentators (scholars who explain the Qur'an) say the same: al-Qurtubi, of the 13th century, and al-Baghawi, of the 12th. They explain it as the matter inside the stomach, which is no longer called farth once it has left. Both also relay an explanation attributed to Ibn Abbas, a cousin and Companion of the Prophet (ﷺ). In this explanation, the food separates in the stomach into dung, milk and blood. That is an explanation of how, which the verse itself does not give. The verse says only that pure milk comes from between the two. So the verse names two things the milk lies between. It says the milk is distinct from both.
“And verily in cattle (too) will ye find an instructive sign. From what is within their bodies between excretions and blood, We produce, for your drink, milk, pure and agreeable to those who drink it.”
Explains farth as the dung-matter that comes down into the stomach (the rumen), and says that once it has come out it is no longer called farth. He says the verse draws attention to God's great power in bringing the milk out pure from between the farth and the blood.
Explains farth as the heavy matter inside the stomach (the rumen), and says that once it has left the stomach it is not called farth. He adds that the milk carries neither the colour of the blood nor the smell of the farth. He also relays the explanation attributed to Ibn Abbas that the fodder separates inside the stomach into dung below, milk in the middle and blood above, with the liver acting on them.
What the best learning of the age said
Aristotle, the Greek philosopher of the 4th century BCE, taught that milk is blood that the body's heat has cooked and refined. He said it is the same stuff as the menstrual discharge. Galen, a 2nd-century physician and the most famous doctor of the Roman world, taught the same. For him, milk is made from blood that has been cooked to perfection. The idea lasted in medicine for many centuries. English doctors were still teaching in the 1700s that milk is blood made white. So when the Qur'an was revealed to the Prophet (ﷺ), this was the learned view: milk is blood, changed.
Aristotle teaches that milk is blood that has been concocted, that is, cooked and refined by the body's heat. Milk, for him, is changed blood. He also holds that milk and the menstrual discharge are of the same nature, so that while a woman is suckling, the discharge does not come.
Galen teaches that milk, like semen, is made from blood that has been perfectly concocted, that is, cooked and refined. He says the vessels that feed the breasts come from far away so that the blood has time to be concocted on the way.
An article on early modern English medicine. It shows that English medical writers of the seventeenth and early eighteenth centuries still described breast milk as blood made white in the breasts, and that the view outlasted Harvey's discovery of the circulation of the blood in the 1620s.
What is known about milk today
Food is broken down in the gut, and its nourishment passes into the blood. The blood carries it to the udder, where the milk is made in the milk-making cells. About 500 litres of blood pass through the udder for each litre of milk. Milk is not whitened blood. Its sugar, lactose, is built inside the milk-making cell. Its main protein, casein, is built there too, from amino acids (the building blocks of protein) that the blood brings.
A dairy guide. It says milk is synthesized in the secretory cells of the udder's alveoli, and that about 500 litres of blood must pass through the udder to make one litre of milk. Lactose is built from glucose and galactose inside the milk-secreting cell. Short-chain fatty acids are built in the gland from acetate and beta-hydroxybutyrate that come from the blood. Milk protein, mainly casein, is built from amino acids that also come from the blood.
From the stomach, through the blood, to the milk
In the cow the path is especially plain. Tiny organisms in her rumen (the first chamber of her stomach) ferment the grass into simple acids such as acetate. These pass through the stomach wall into her blood. The udder takes them from the blood to build part of the milk fat. So the milk is neither the stomach's contents nor the blood. Aristotle thought the blood itself was cooked into milk. In fact the blood only brings raw materials. The gland's cells build the milk's sugar and its main protein, which are not in the blood, and much of its fat. The raw materials come from the stomach's contents, by way of the blood. The udder makes something new from them: milk that is pure and pleasant to drink, as the verse says.
An extension guide to how cattle digest their food. It says microbes in the rumen ferment sugars into volatile fatty acids (acetate, propionate and butyrate), and that these acids are absorbed across the rumen wall into the blood.
A dairy guide. It says milk is synthesized in the secretory cells of the udder's alveoli, and that about 500 litres of blood must pass through the udder to make one litre of milk. Lactose is built from glucose and galactose inside the milk-secreting cell. Short-chain fatty acids are built in the gland from acetate and beta-hydroxybutyrate that come from the blood. Milk protein, mainly casein, is built from amino acids that also come from the blood.
Aristotle teaches that milk is blood that has been concocted, that is, cooked and refined by the body's heat. Milk, for him, is changed blood. He also holds that milk and the menstrual discharge are of the same nature, so that while a woman is suckling, the discharge does not come.
“And verily in cattle (too) will ye find an instructive sign. From what is within their bodies between excretions and blood, We produce, for your drink, milk, pure and agreeable to those who drink it.”
Perspectives
Ancient medicine
Aristotle taught, and Galen and later physicians repeated, that milk is blood, cooked and refined by the body.
Aristotle taught that milk is blood that the body has cooked (he called it "concocted").
Galen taught that milk is made from blood that has been perfectly concocted.
The idea that milk is blood made white was still taught in European medicine in the eighteenth century.
The Islamic perspective
Qur'an 16:66, revealed to the Prophet Muhammad (ﷺ), is a sign. It placed milk between the stomach's contents and the blood and called it pure. The learning of its age called milk changed blood. Nothing learned since contradicts the verse.
The Qur'an says pure milk comes out from between farth (the stomach's contents) and blood, and calls this a sign.
The classical commentators define farth as the matter inside the stomach.
Milk is made in the udder's own cells from materials the blood brings. Those materials come from digested food.
The verse did not repeat the ancient teaching that milk is changed blood, and nothing known today contradicts its words.
The verse invites the reader to think about where milk comes from. It also points to Who brings it out, pure and pleasant to drink, from between the two.