“Now, order your livestock and everything you have in the open brought under shelter; every man and beast that is found outside, not having been brought indoors, shall die when the hail (borrod) comes down upon them!’” (Shemos 9/19)
Zera Shimshon asks in the name of the Mefarshim; animals that were outside were killed both in this plague of borrod, and in the plague of devver (an epidemic). This being so, why did Moshe order to bring the animals inside only before this plague, which was the seventh one, and not earlier, before the plague of devver, the fifth plague?
Another question Zera Shimshon asks; It is written that during the plague of shechin (boils) animals were also smitten. Rashi asks; during the plague of devver, which was the plague before shechin, all the animals had already died, so what does it mean that the animals were smitten with boils? They were already dead! Rashi answers that only animals left in the field died during the plague of devver . The animals that were brought inside by people who were afraid of Hashem's plague were not smitten by devver but were later smitten with shechin.
We learn from here that before the plague of devver the Mitzriyim understood on their own to shelter their animals, why, then, did Moshe have to order the Mitzriyim before the plague of borrod?
Zera Shimshon answers these questions in two ways. The Zohar points out something very interesting: devver and borrod are spelled with the same letters; bais, daled, and raish. The only difference between them is the order of the letters and the vais in the word devver turned into a bais in the word borrod. The Zohar explains the reason for this is that devver implies a milder plague which is alluded to by the usage of the letter "vais" which is has softer sound than a "bais". The devver itself did not kill the wildlife, it only created a disease that made the animals sick and then they died by themselves. Borrod, on the other hand, which is written with a "bais", a harder sound, was a harsher plague in that it killed the animals directly and was also accompanied with loud noises. Since the Mitzriyim did not do teshuva after their animals were smitten mildly with devver, Hashem brought on them a more severe plague.
According to this, explains Zera Shimshon, at the time of the plague of devver the Mitzriyim understood that since the plague was comparatively mild they could save their animals if they were brought inside. Therefore, there was no reason for Moshe to order them to do this.
However, the plague of borrod was harsh, and Moshe was afraid the Mitzriyim would think that they would not accomplish anything if they would shelter their animals because the plague would somehow destroy the animals wherever they were. Therefore, Moshe had to order the Mitzriyim to bring the animals indoors.
What still has to be understood, though, is why did Moshe all of the sudden have mercy on the animals of the Mitzriyim? The plagues were sent to destroy Mitzrayim. Why all of a sudden did Moshe want to save their animals?
The answer is that saving of the animals was not an act of chessed towards the Mitzriyim. On the contrary, the animals were saved in order to punish the Mitzriyim! Hashem wanted to make sure that the Mitzriyim would chase Bnei Yisroel when they crossed the Yam Suf, causing the Mitzri warriors to drown. If the Mitzriyim did not have animals they could not chase Bnei Yisroel and they wouldn't have received the punishment they deserved.
Paradoxically, the chessed towards the animals was really a punishment for the Mitzriyim!
It is written in Yalkut Shemoni (remez 182) the reason Hashem brought the plague of devver was because Bnei Yisroel were forced to shepherd the animals of the Mitzriyim and the reason Hashem brought the borrod was because Bnei Yisroel were forced to tend the Mitzriyim's orchards and fields. In other words, the main purpose of the devver was to destroy the Mitzriym's animals and the main purpose of the borrod was to destroy the Mitzriyim's trees. Therefore, if Moshe would have ordered the Mitzriyim at the time of devver to bring the animals indoors, the plague would not have accomplished what it was meant to do, to destroy the animals. On the other hand, since the purpose of the borrod was to destroy the trees and plants, bringing in the animals did not contradict it, and Moshe was able to tell the Mitzriyim to give shelter and save the animals.