Not extremely clear. The most common explanation is that the topknot or plume helps attract a mate. A healthy plume tells a potential suitor that he has excellent genes to pass on to baby chicks. So, a female quail prefers a male with a full plume of feathers over a balding one. Rogaine anyone?
Then why do both male and female have plumes? Either they both try to attract each other, or, as in many species, the female has similar traits to the male (or vice versa) even if they are not functional in both sexes. For example, in most mammals both male and female have breasts even though they only serve a purpose in a nursing female.
When a quail is angry or charging, the plume rises (as does its blood pressure, I suspect!). Therefore, the plume may also be an indication of the bird's mood.
One final fun fact as we approach Christmas:
A partridge is a larger relative of the quail; they both belong to the pheasant family. However, a partridge does not have a topknot, and also, incidentally, does not hang out in pear trees. It is native to Europe, Asia, Africa, and the Middle East, and is a ground-dwelling seed-eater.
And a partridge on the seedy ground...doesn't have the same ring to it, does it?