Johann Sebastian Bach wrote this piece as part of his "Well-Tempered Clavier" - a collection of preludes and fugues. A prelude is typically performed before an event begins.