Ghazal originated in Iran in the 10th century A.D. It grew from the Persian qasida, which verse form had come to Iran from Arabia.The qasida was a panegyric written in praise of the emperor or his noblemen. The part of the qasida called tashbib got detached and developed in due course of time into the ghazal. Whereas the qasida sometimes ran into as many as 100 couplets or more in monorhyme, the ghazal seldom exceeded twelve, and settled down to an average of seven. Because of its comparative brevity and concentration, its thematic variety and rich suggestiveness, the ghazal soon eclipsed the qasida and became the most popular form of poetry in Iran.

-Excerpt from Masterpieces of Urdu Ghazal - From 17th to 20th Century, by K.C. Kanda

The modern Ghazal is a poem with seven couplets.
The purpose of this poem style is to connect every couplet with every other, in this pattern:
AA
BA
CA
DA

Many poets who write in English expand this into a series of seven quatrains. Because it's fun.