"When jamming to a track why is it important to know the key, chords and chord changes. How does that information help."
It's important because then you'll know which notes you can use, as well as how and when to use them to make musical phrases.
Improvisation has 3 general steps: find the key, target chord tones, build melodies. The melodies you build (the licks, lines, phrases, motifs) become your vocabulary.
This collection of tutorials cover the basics of learning to improvise.
https://www.guitartricks.com/collection/learning-to-improvise
This page has a great collection of lead guitar licks organized by musical style.
https://www.guitartricks.com/lead-guitar
Hope that helps!
Christopher Schlegel
Guitar Tricks Instructor
Christopher Schlegel Lesson Directory