A prelude is a short introduction to a larger piece of music such as a fugue or opera. For example, that sentence could be a literary prelude to the explanation of a fugue in the next paragraph.
A fugue is a piece of music that is built on multiple melodies and echoes of the same melodic theme. Johann Sebastian Bach was well-known for his fugue compositions, so skilled in the style he would often improvise them. It became a popular musical technique in the Baroque Period (1600-1750) but can be heard in some popular music today.
To break that down further, a fugue is usually one main melody played repeatedly but in various forms, similar to a theme in a film score. The main melody is called a “subject.” In a fugue, the subject would jump across octaves, vocal parts, and sometimes different keys. Check out this video for a visual explanation of one of Bach’s pieces.
Another term that is helpful to know for understanding a fugue is counterpoint. Counterpoint is when multiple melodic lines can be followed individually and also played together. In vocal ensembles, counterpoint and fugues often show up dancing across the vocal parts (Soprano, Alto, Tenor, Bass). For a piano or organ piece, the melodies will appear in both hands.
Sources: “What is a Fugue? (Music Appreciation)”