There is an analogy between playing jazz, or rock, or funk, and speaking. In speaking you must know your words, and to speak well you must know the grammar and cadences of English. But that is not enough, and in fact knowing all the words, rules of grammar, and all the rhythms of speech won't even get you started in creating a sentence. In order to start a sentence you have to have something you want to say, that is the starting point, a thought in your head. Then, starting with a thought, and knowing the words, rules, and cadences, you can create a sentence.
The same thing is true in music, thus a student can know the notes and scales, the rules of harmony, and the rhythmic patters of jazz, but still be unable to play a line because he/she does not have a musical thought in his/her head. Trust me, I'm sure about this.
So, when someone asks, how do I play over such and such a progression, or how do I begin to improvise, the responses usually involve scales, harmony, and rhythms, but they leave out the hard part, which is where in hell do you get the idea to play. Every line has to begin with an idea, a feeling, a musical inspiration. That's the hard part.
I struggle with this constantly. I've gotten to where if the tune is a blues I can usually just try real hard and something will appear. If the tune is a jazz standard I can work on the tune for a week or two and usually come up with a few ideas that give me something to work with.
Taking it one step further just as devil's advocate .... I'll say that whenever I think about scales, or rhythmic patters, or rules of harmony, my mind will be so occupied that a musical thought will never appear. So, you need to know this stuff I suppose, but it has to be way in the background, because if it's in the foreground of your mind, at least if it's in the foreground of my mind, there is no room left for a musical idea to squeeze in.
On the other hand, my former teacher, a very badd man, said that as he played he not only had the chords floating by in his mind but also particular inversions, and still his creative mind was unfettered by all this information. It must be nice !