There are two ways in which knowledge and the fear of Allah are related. The first is that true fear of Allah comes about as the result of having proper knowledge of Allah and His perfect attributes.
Ibn `Abbâs said about this verse: “They are those who know that Allah is capable of all things.”
He also said: “The verse means: The only people who fear me are those who know my power, my might, and my dominion.”
Ibn Kathîr says in his commentary of this verse: “The only people who fear Allah in the true sense are those who are knowledgeable about Allah. This is because the more knowledge a person has about the Almighty, the All-Powerful and All-Knowing, who possesses the attributes of perfection and the best of names – the more perfect and complete this knowledge is – the greater and more total his fear of Allah will be.” [ Tafsîr Ibn Kathîr ]
The second way that the fear of Allah and knowledge are related stems from the fact that the fear of Allah is to seek to prevent Allah’s punishment by carrying out Allah’s commands and abstaining from His prohibitions. Consequently, a Muslim needs to have knowledge of these matters in order to fear Allah properly. An ignorant Muslim may have a sense of fear, but he will not be able to fully carry out what that fear requires of him.
Ibn `Abbâs said: “To have knowledge of the Most Merciful is to be someone who associates nothing as a partner with Him, who deems lawful what He has made lawful, who prohibits what He has prohibited, who preserves what He has enjoined upon him, and who has certainty that he shall meet Him and that his actions will be accounted for.”