It is written in the Gemara Berachos (55/A); Rebbi Yochanon said, "HaKadosh Baruch Hu only gives wisdom to someone who has wisdom in his heart like as it is written (Daniel 2/21). 'yahaiv chachmah l'chakeemin' - I have placed wisdom in the heart of the wise." Rav Tachlifa bar Ma'arava heard this and went before R' Avahu and told it to him. R' Avahu told him; You derived this from that possuk but we learn this idea from the posuuk in Chumash, "uv'laiv kahl chacham laiv nah'satti chachmah" - In the heart of every wise-hearted person I have put wisdom. (Brachos 55/A).
In other words, there is a machlokos between Rebbi Yochanan and R' Avahu from where do we derive the concept that Hashem gives wisdom to the wise. Rebbe Yochanan derives it from the possuk in Sefer Daniel, "yahaiv chachmah l'chakeemin" - I have placed wisdom in the heart of the wise. R' Avahu learns it from the possuk in this week's parsha, "uv'laiv kahl chacham laiv nah'satti chachmah" - In the heart of every wise-hearted person I have put wisdom.
Zera Shimshon asks a question in light of the well-known principle that when a certain halacha or idea can be derived from Chumash or from the rest of Tanach it is preferable to quote the possuk in Chumash. This being so, why did Rebbi Yochanan quote the possuk in Daniel and not the possuk in Chumash like R' Avahu?
To understand the answer Zera Shimshon begins with the question of the Mefarshim, "What is the purpose of giving wisdom to wise people?" By definition, wise people have wisdom! Why does Hashem give them something they already have? It would be more beneficial to give wisdom to ignorant people!
Zera Shimshon answers in light of the Gemara in Niddah (69/b-70/a) that the citizens of Alexandria asked twelve questions to Rebbi Yehoshua ben Chinana. One of the questions was, "What should a person do to become wise?" He answered, "Increase the time that you learn and minimize the time that you work." They argued, "Many people have done that but they were not successful?" He answered back "Pray for mercy from Hashem". The Gemara concludes, "Both are needed. It is not enough one without the other".
From this Gemara we learn, that to learn with great hasmadah (long hours and diligently) does not necessarily result in becoming a true Talmid Chacham. He might forget what he learns, misunderstand what he learnt or come to wrong conclusions. In addition to learning diligently one must also pray to Hashem. Only then, can he be confident that he will become a true Talmid Chacham.
According to this, the statement "HaKadosh Baruch Hu gives wisdom to the wise" means that Hashem gives wisdom to one who has the wisdom to davven to be wise. Hashem answers such a person's prayers and grants him true long-lasting wisdom.
According to this, that Hashem grants wisdom only to someone who also davvened, we can understand why Rebbi Yochanan didn't bring a prove from the possuk, "uv'laiv kahl chacham laiv nah'satti chachmah" - In the heart of every wise-hearted person I have put wisdom. As a matter of fact, not only is that possuk not a proof it seems to be a disproof!
This possuk refers to the time when Hashem commanded Moshe to build a Mishkan and Hashem told Moshe in the past tense "uv'laiv kahl chacham laiv nah'satti chachmah" - In the heart of every wise-hearted person I put wisdom. - I gave wisdom already so there will be people who will be able to do carry out what I command Betzalel to do. According to Rebbi Yochanan, how can this be? They surely didn't davven for the wisdom to build the Mishkan since at that time they didn't yet know that a Mishkan was going to be built and that they would be the craftsmen! It is for this reason that Rebbi Yochanan brought a proof from the possuk in Daniel, "yahaiv chachmah l'chakeemin" - He gives wisdom to the wise, that Hashem only gives wisdom to someone who toils in learning and also davvens to Hashem to be wise.
However, there is still a question; how can Rebbi Yochanan understand that Hashem gave wisdom to the craftsmen who built the Mishkan even though they didn't davven for it?
Zera Shimshon explains that Rebbi Yochanan differentiates between regular chachmah, wisdom and the extra-special chachmah needed to build the Mishkan. Hashem gives regular chachmah only to people that davven for it, while Hashem gave the extra-special chachmah to build the Mishkan even without their asking and davvening for it.
What we have to understand now is how did Rebbi Avahu derive that true chachmah can be attained only through hard work and prayer from the craftsmen of the Mishkan since that they certainly didn't pray for wisdom to build the Mishkan?
Zera Shimshon explains that Rebbi Avahu derived this from a seemingly extra word in the possuk. It is written, "uv'laiv kahl chacham laiv nah'satti chachmah" - In the heart of every wise-hearted person I have put wisdom. Seemingly it could have been written, "uv'laiv kahl chacham nah'satti chachmah" - In the heart of every wise person I have put wisdom. Why is it written "kahl chacham-laiv" In the heart of every wise-hearted person?
The answer is that it alluded to the fact that to attain wisdom it is not enough to only be wise, meaning to learn with hasmadah but one must also use his heart, to pray to Hashem to sustain the wisdom. Concerning the craftsmen of the Mishkan even though they didn't know that they were going to be craftsmen and that they needed an extra-dose of chachma they davvened to Hashem for regular chachmah not related to the building of the Mishkan and Hashem gave them the extra-special chachmah needed to build the Mishkan!
To summarize. Zera Shimshon asked why did Rebbi Yochanan derive that Hashem only gives wisdom to wise people from a possuk in Daniel and not from the possuk in Chumash, "uv'laiv kahl chacham laiv nah'satti chachmah" - In the heart of every wise-hearted person I have put wisdom which is speaking of the craftsmen who helped build the Mishkan.
He begins the answer by first explaining that the statement, Hashem only gives wisdom to the wise means that Hashem only gives wisdom to people who toil to be wise and also davven to Hashem to be wise. Since the craftsmen of the Mishkan did not know that they were going to take part in building the Mishkan they obviously didn't davven for the wisdom to do it and Rebbi Yochanan couldn't bring a proof from them.
However, according to this how did these craftsmen attain the chachmah that they needed. Zera Shimshon answers that the extra-special chachmah needed to build the Mishkan was given to them without their asking from Hashem for it and Rebbi Yochanan is only referring to regular chachmah.
Rebbi Avahu derived this idea from a seemingly superfluous word of "laiv" in the phrase "chacham laiv".