Another interpretation (of Genesis 42:1): "Now Jacob saw that there was grain in Egypt," etc. This is what Scripture says (Job 32:9): "It is not the many who are wise, nor the elders who understand judgment." Not everyone who occupies himself with Torah becomes wise; rather, "surely it is a spirit in a person" (Job 32:8). Who said this verse? Elihu said it. When? At the hour when Job's friends were rebuking him and he was answering them. When Job had silenced them, Elihu saw that they could not answer him, as it is said (Job 32:5): "And when Elihu saw that there was no answer," etc. At that hour he said to them: "It is not the many who are wise" — not everyone who occupies himself with Torah becomes wise; rather, "surely it is a spirit in a person" — that is, unless the Holy One, blessed be He, has placed within him a spirit so that he may be practiced in his learning, as it is said (Job 32:8): "Surely it is a spirit in a person." A matrona asked Rabbi Yose ben Halafta. She said to him: Behold, all the praise of the Holy One, blessed be He, is that He gives wisdom to the wise, as it is said (Daniel 2:21): "He gives wisdom to the wise." Should it not rather have said, "He gives wisdom to the foolish"? He said to her: Do you have jewels? She said to him: Yes. He said to her: If a person comes to borrow your jewels, would you lend them to him? She said to him: If the person were of standing (that is, a worthy person), I would lend him my jewels. He said to her: You would lend your jewels only to a person of standing; shall the Holy One, blessed be He, give wisdom to fools? Therefore it says (Daniel 2:21): "He gives wisdom to the wise." Elihu said: Not everyone who asks does He give to him. Thus (Job 32:9): "It is not the many who are wise" — rather, "surely it is a spirit in a person."
Why God Gives Wisdom Only to the Wise - Jacob, Elihu, and Rabbi Yose
Midrash Tanchuma Buber, Miketz 9:1
ד"א וירא יעקב כי יש שבר במצרים וגו'. זש"ה לא רבים יחכמו וזקנים יבינו משפט (איוב לב ט), לא כל מי שהוא עוסק בתורה הוא מתחכם, אלא אכן רוח הוא באנוש (שם שם ח), מי אמר הפסוק הזה, אליהוא אמרו, אימתי בשעה שהיו אהביו של איוב מוכיחין אותו והיה משיבן, כיון שסילקן איוב, ראה אליהוא שלא יכלו להשיבו, שנאמר וירא אליהוא כי אין מענה וגו' (שם שם ה), באותה שעה אמר להם לא רבים יחכמו, לא כל מי שעוסק בתורה מתחכם, אלא אכן רוח הוא באנוש, אלא אם כן נתן בו הקב"ה רוח כדי שיהא רגיל בתלמודו, שנאמר אכן רוח היא באנוש. שאלה מטרונא לר' יוסי בן חלפתא אמרה לו הרי כל שבחו של הקב"ה שהוא נותן לחכמים חכמה, שנאמר יהב חכמתא לחכימין (דניאל ב כא), לא היה צריך לומר אלא יהב חכמתא לטיפשין, אמר לה יש לך קוזמין, אמרה לו הן, אמר לה אם בא אדם לשאול קוזמין שלך, משאלת את אותם לו, אמרה לו אם יהיה אדם אוקנוס (פי' אדם חכם), אני משאלת לו קוזמין שלי, אמר לה קוזמין שלך אין את משאלת אלא לאדם אוקנוס, הקב"ה יתן את החכמה לטיפשין, לפיכך אמר יהב חכמתא לחכימין, אמר אליהוא לא כל מי שהוא מבקש הוא נותן לו, הוי לא רבים יחכמו [אלא אכן רוח הוא באנוש.