"Hair of the dog" is an English idiom referring to the practice of drinking more alcohol to cure a hangover. Some people believe that doing so will actually lessen hangover symptoms, although, in actuality, drinking more alcohol may prolong the hangover. Using the "hair of the dog that bit you" means that someone is using the thing that caused the pain to cure it. The idiom has a historical basis, thanks to the antiquated belief that curing a dog bite required getting some fur from the dog that administered the bite and applying it on the bite area.
Using idioms in speech is a way to add extra expression and color to otherwise mundane details. Idioms gain a figurative meaning through popular usage in a culture, and this figurative meaning often diverges greatly from both the origins of the phrase and the literal meaning of the words involved. As such, idioms hold significant colloquial power in the language. One such idiom is the ancient phrase "hair of the dog," which is still in popular use today.
If someone uses this idiom, it means that someone, either the speaker or a person he or she is addressing or referencing, is suffering from a hangover. A hangover occurs when someone drinks too much alcohol, causing withdrawal symptoms from alcohol poisoning that can include headache and nausea. There is a belief that drinking a little alcohol will actually cure the hangover, or at least lessen its severity. This leads to someone taking the "hair of the dog."
As an example, imagine that someone drank far too much the night before and is feeling the effects of a hangover in the current morning. He might say, "I can't stand these headaches anymore; let me try a little hair of the dog to ease the pain." The implication in the sentence is that he will be drinking more alcohol to cure the pain that was caused by alcohol in the first place.
In most cases with idioms, the origins come from something that actually occurred or was even in common practice at some point in the past. This particular idiom refers to the mistaken belief that curing a dog bite required taking fur from the dog that made the bite and applying that fur to the wound. That is why the idiom is often used in its complete form, "hair of the dog that bit you."