J.S. Bach was born into a musical family, including his father and two uncle’s; his Grandfather, Great Grandfather and Great-Uncles - all professionals. J.S. also had several sons who were professional musicians.
Funny - after a time, to be an organist in that part of Germany was to be known as ‘a Bach’.
Organ was THE instrument in the early part of Bach's life (often scored with vocals). Being a great composer/keyboardist for the church or royalty was, arguably, the best way for a musician to make a good living at that time.
It is a well-known story that "Johann Sebastian Bach walked more than 200 miles to listen to the great organist and composer Dieterich Buxtehude in Lübeck (Germany)." Buxtehude was, primarily, the organist at St. Mary’s church.
Outside of Germany - Pachelbel, Vivaldi, Albinoni, and Couperin are also prolific musicians whose music was well known to J.S.
Most music was shared as written works, but improvisation was part of daily life was well...
I hope this helps... A deeper dive awaits you!

