(In the excerpt below Sh Uthaymeen explains that contagion (i.e. infectious diseases) are real and that the Prophet sallAllaahu’alaihiwasallam affirmed this. He sallAllaahu’alaihiwasallam also said that one should take precautions against the spread of such diseases by isolating the sick from those who are healthy).
Sh Uthaymeen continued in his commentary:
With regard to the words “no contagion (‘adwa)”: contagion is something that happens, as is indicated by the words of the Prophet (peace and blessings of Allaah be upon him), “Do not put a sick one with a healthy one” i.e., the owner of a sick camel should not bring it to the owner of a healthy camel, lest the contagion be transmitted.
And the Prophet (peace and blessings of Allaah be upon him) said: “Flee from the leper as you would flee from a lion.” Leprosy is a serious disease that is transmitted quickly and kills the one who catches it. It was even said that it is a plague. Hence the command to flee from the leper so that the disease will not be transmitted from him to you. This is an affirmation of the effect of contagion, but its effect is not inevitable in such a way that it affects people by itself. The command of the Prophet (peace and blessings of Allaah be upon him) to flee and not to bring sick camels to where healthy camels are comes under the heading of avoiding the means (that lead to sickness), not attributing the effect to the means themselves. The means do not affect anything themselves, but we should avoid the things that may be a cause of calamity, because Allaah says (interpretation of the meaning):
“and do not throw yourselves into destruction”
[al-Baqarah 2:195]
We cannot say that the Messenger (peace and blessings of Allaah be upon him) was denying the effect of contagion, because contagion is something that is proven to exist in real life and is mentioned in other ahaadeeth.
When the Prophet (peace and blessings of Allaah be upon him) said “there is no ‘adwa”, a man said: “O Messenger of Allaah, the camels may be healthy like deer, then a mangy camel comes and mixes with them and they all get the mange.” The Prophet (peace and blessings of Allaah be upon him) said: “And who infected the first one?” meaning that the disease came to the first one with no contagion, rather it came from Allaah. By the same token, if it was transmitted by contagion, then it was transmitted by the command of Allaah. A thing may have a known cause or it may not have a known cause. The mange of the first one does not have a known cause, apart from the fact that it happened by the will and decree of Allaah, and the mange that came after it does have a known cause. But if Allaah wills the camel will not become mangy. Hence sometimes a camel may get the mange but then it recovers and does not die. The same happens with the plague and cholera; they may enter a house and some may get sick and die, while others are not affected at all.
[Sharh Kitaab al-Tawheed, 2/80]
(Note that “mange” refers to a type of skin disease which affects animals).