They play in the same key, respond to different cues from each other, and they know how different styles of music should be structured. Some styles of music are easier to jam with people you don’t know. A blues jam is easy because the structure is common knowledge.
Edit: Adding more context here. A “key” in music is a group of notes that are used as the foundation of a song. The notes in a key sound good together, so knowing the key allows experienced musicians to play cohesively.
Latest Answers