The first occurrence of the word "raven" is in the story of Noah and the flood. Genesis 8:6-8 reads:
After forty days Noah opened the window he had made in the ark and sent out a raven, and it kept flying back and forth until the water had dried up from the earth. Then he sent out a dove to see if the water had receded from the surface of the ground.So, we first hear of the raven as it is being sent out from the ark. The rabbis note that the task of searching for water is not mentioned as it is with the dove. The raven is just "sent out". In the Talmud (Tractate Sanhedrin 108b), a conversation is recorded between Noah and the raven. The raven is upset because it thinks Noah is trying to put an end to its species (only two were brought on the ark). The raven also accuses Noah of wanting to "know" the raven's wife. Noah exclaims, "You evil one!" (I can almost see this happening in Narnia!)
The rabbis teach that those who accuse someone of a blemish, have that blemish themselves (see Jesus's statement about a speck in one's eye). They say Noah deduced that the raven had had relations with its wife on the ark, an act that was strictly forbidden according to the rabbis. From this it appears Noah is evicting the raven from the ark because of bad behavior.
The rabbis then comment on the nature of Noah. According to Rashi, "Noah was a perfect man in his generation... Some of our Rabbis explain the words 'in his generation' to his discredit--he was a righteous man in his own generation, but had he been living in the generation of Abraham, he would have not been reckoned as anyone special". The comparison between Abraham and Noah continues. Both were surrounded by evil, Abraham by Sodom and Noah by a corrupt world. In both cases, God called for punishment. Abraham begged and pleaded for God to save Sodom. But Noah just accepted the judgment and did what was commanded to save his family. The rabbis conclude that Noah lacked mercy and concern for his fellow humans.
This lack of mercy is again shown in Noah evicting the raven. In a midrash, the rabbis's describe Noah as saying the raven "had no purpose" and was expendable. But God steps in with mercy and gives the raven a mission. The Torah says that the raven flew "until the water had dried up from the earth".
Enter Elijah. His first act is to stop the rain, and the earth dried up. Again the rabbis comment on character. They say there are two possible ways to win over a sinner: 1) punish them, or 2) win them over. Noah drove out the raven and Elijah punished Israel. Neither showed mercy, both were bent on punishment.
So the rabbis comment that the raven was sent to teach Elijah a lesson. The raven was seen as a cruel creature that doesn't even feed its own (see Psalm 147). If a raven fed Elijah, how much more should Elijah have "fed" the people of Israel and won them over to follow God? The lesson for Elijah continues with him traveling to Zarephath, which means "refinement". Elijah spent three years in refinement where he learned mercy and then returned to Israel to confront the evil and win over the Israelites.
A common theme echoes through these stories, "I desire mercy, not sacrifice." Everyone has worth, so do not judge.
Clearly these themes are reflected in the teachings of Jesus (for instance, see the sermon on the mount in Matthew 6-8). I also wonder if echoes of Noah and Elijah are reflected in his teachings about worry. In Luke 12 we read:
Then Jesus said to his disciples: "Therefore I tell you, do not worry about your life, what you will eat; or about your body, what you will wear. Life is more than food, and the body more than clothes. Consider the ravens: They do not sow or reap, they have no storeroom or barn; yet God feeds them. And how much more valuable you are than birds! Who of you by worrying can add a single cubit to his height? Since you cannot do this very little thing, why do you worry about the rest?The ravens turn your imagination to the flood. And so does the cubit, maybe. There was a one-cubit window in the ark. Why didn't Noah just look out the window to see if the land was dry? Was Noah just short enough that he couldn't see out the window and hence the need for the dove to look for dry land? Was he worrying about a lack of food on the ark? I wonder.
In conclusion, it seems ravens were sent to teach Elijah a lesson of mercy. If ravens could feed Elijah, how much more should he have fed Israel?
( I found a variety of sources online for this material. Two of the best summaries (which I've drawn from heavily) are from tfdixie and shemayisrael. Other interesting notes maybe worth exploring are the three years of Elijah refinement related to Jesus' three ministry years, and are there parallels between the widow at Zarepheth and the woman at the well in John?)