“…And in the heart of every wise-hearted person I have placed wisdom.” (Exodus 31:6)
We find a similar statement in Daniel 2:21, “He gives wisdom to the wise.”
There’s an obvious problem here. If God only gives wisdom to those who are wise – how do they get their wisdom in the first place?
R’ Chaim Shmuelevitz suggested that what distinguishes the person to whom God will give wisdom is their desire and craving for wisdom. King Solomon was the wisest person to ever live. When he was young, God came to him in a dream and offered to give him anything he would request. The one thing Solomon sought was wisdom (I Kings 3:5-12).
R’ Chaim of Volozhin offered another approach. King David wrote, “The beginning of wisdom is the fear of Hashem.” (Psalm 111:10). (Actually, Solomon expressed the same thought in Proverbs 9:10).
A person can receive this initial “wisdom” (the fear of Hashem) through their own efforts. Our sages teach (Berachot 33b) that “everything is in the hands of Heaven except for the fear of Heaven.” When a person develops their fear (actually awe) of Hashem – they are then a fitting vessel to receive the gift of wisdom.