At our old church (small) the organist was VERY talented and would do improvisions on the pieces. One time I asked him about it, and he said how he worked for days, hours and hours on it, rewriting the entire piece.
A few years later after a very impressive adaptation I asked how long he had spent on re-writing it. He explained how he had gone someplace to learn “jazz” and improv music. Now all he did was he just had a few ideas in his head that he practiced the main ideas the night before, and then just “did it”. He laughed to think about how he used to do them!
I heard a story like that in a Harry Harlow interview. He was a Jewish NYer who went into salsa music in the 50s and became very successful at it. He said in the beginning he would get kicked out of bands for not being able to improvise during certain parts of the songs so he would listen to recorded salsa music and memorize the improvisations note for note. But he said after a while it was all just easy.