Jehovah God gave wisdom [the knowledge of how to properly apply and/or regulate the involved elements] to those who asked of Him (James 1:5). Wisdom differs from knowledge. For example one may have knowledge of all the ingredients of a cake yet not have the wisdom to properly combine them so that the cake is satisfying to the palate.
Jehovah God gave wisdom to those who asked of Him in faith without any doubting (James 1:6a). He refused to honor the request of those who asked not in faith but doubting (James 1:6b-7).To ask without faith is to doubt. To doubt is to be double-minded (James 1:7-8). Double-mindedness blocks the flow of blessings from God.