In Parshat Ekev, Dvarim 11:13-15, we read verses that are well known as they are recited twice a day in the second paragraph of the Shma:
And it will come to pass that if you continually heed My commandments that I command you today, to love HaShem, your God, and to serve Him, with all your heart and with all your soul- then I will provide rain for your Land in its proper time, the early and late rains, that you may gather in your grain, your wine and your oil. I will provide grass in your field for your cattle and you will eat and be satisfied.
Ibn Ezra points out that when verse 15 says “you will eat and be satisfied”, it is referring to eating the grain, wine and oil mentioned in verse 14 and not referring to the grass in verse 15.
Ramban’s interpretation is that it refers to everything: “And you shall eat and be satisfied” with the corn, wine and oil and also the sheep and cattle will be satisfied with the grass in the field.
Ramban also quotes the midrash, Sifre: “And you shall eat and be satisfied”- When your cattle eats and is satisfied it works the ground with strength as it says in Mishlei 14:4: “Many crops come by the strength of the ox.”
In the Talmud, Brachot 40a, Rav Yehuda taught in the name of Rav:
It is forbidden for a person to eat before he gives food to his animal as it says (Dvarim 11:15) “I will provide grass in your field for your cattle” and only then does the verse state “and you will eat and be satisfied.”
Rav Sheshet teaches that if a person said the blessing over the bread but did not yet take a bite and in the meanwhile he says “Knead for the oxen”, he can eat the bread without repeating the blessing, as instructing someone to feed the animals is considered a necessary preparation for the meal and is not considered an interruption.
This Gemara shows how important it is to feed the animals first as there are very rare circumstances where you can make the blessing and then take a break in between.
Pele Yoetz 36:1 explains that one should only raise chickens if they are able to care for them properly. The owner must give them their food at the proper time, before he eats, so that they don’t get into a situation of tzaar baalei chayim (animal cruelty).
The Magen Avraham 168:17 codifies the law as a Biblical mitzvah and says that it is forbidden to eat before your animals have eaten, but states that you may drink before your animals as we see in the case of Rivka (Breisheet 24:14) who gives Avraham’s servant water to drink first and then proceeds to water his camels.
Most other poskim (Halachic authorities) view this mitzvah as Rabbinic.
Rambam, Mishneh Torah, Sefer Kinyan, Hilchot Avadim 8 teaches:
The earlier Chachamim would give their servant portions from all of the dishes that they would eat, and they would feed their animals and their servants before they themselves would sit down to eat. As it says in Tehillim 123:2: “Behold, as the eyes of servants look to the hand of their masters and the eyes of a maid to the hand of her mistress; so our eyes wait upon HaShem, our God, until he will be gracious to us.”
According to the Rambam, it is a midat chasidut (proper behavior) to feed your animals before you eat.
We see from here the importance of treating animals properly, not just because it will help them be more productive in the long run, but because it is the right thing to do.