Basic counterpoint is used in just about any style of music. It may be as simple as the bass line answering the melody or a second and harmonizing instrumental part. The fugue however, is a full scale utilization of strict and concise counterpoint which composers began writing in the mid 17th century. The form begins with one voice, vocal or instrumental, introducing the theme or main musical idea of a composition. This "idea" is continued by a second voice which answers the first as the first begins a new idea; a third voice then enters restoring or returning to the main theme.
Composers have long used counterpoint since its discovery during the early Renaissance. Imitations of the main musical idea by a second voice or instrument have long been a favorite of not only composers; audiences too enjoy its presence. In Baroque times, tunes like Mozart's 'Ah vous diraije, maman' (Twinkle Twinkle Little Star) are perfect examples of such use of counterpoint, despite the composition being merely a 'variation' of a French folk song; it has a catchy melodic voice to it which becons the participation of other voices or musical parts. It's true; counterpoint can be found in nearly any song you can think of.
18th century composer Johann Sebastian Bach was the first real exponent of the fugue. He wrote two books of fugues and preludes for harpsichord known as "the 48" and additional fugues for chamber ensembles, organ and orchestra. The choral fugue was mastered by George Frideric Handel, the acclaimed best at introducing more dramatic effects into his oratorios. Fugues flourished during this century; loved by both the composers and the audience alike.
After the Baroque Period composers moved on to the more strict and demanding styles of Classical composing. The fugue had become a familiarity losing some of it's appeal. As the fugue grew less and less mainstream, the church still featured the fugue in many ceremonies or occasions. However, the fugue is not lost by any measure. Composers of modern times still return to the form again and again.
Early Classical Fugue
'The Art of Fugue'
Composed by John Sebastian Bach 1750
'24 Preludes and Fugues'
Composed by Dmitri Dmitriyevich Shostakovich 1951