Once upon a time – when Harry Potter and his friends and enemies were in their fifth year of studies – Hogwarts was under control of a certain Dolores Umbridge, and that included Hogwarts’ house elves.
Now, your average house elf is a meek and inconspicuous creature, unlike, say, Dobby or Winky, but on that year a certain, well, delegation of house elves came by Umbridge’s office and asked for an evening off or to celebrate a holiday of theirs. Nothing fancy, just some time off. However...
Umbridge, is, well, Umbridge. Call it a diagnosis, a fate, whatever. She refused the house elves flatly, and the house elves – because they lacked someone like Dobby along their number - complied.
And so, back they were walking to the kitchen, feeling very bitter (nowhere bitter as Dobby, but still sad enough), when who should come across them, but Draco Malfoy?
Now, Malfoy – he’s a Slytherin, not a Gryffindor, like Potter. When he asked the failed delegation why they were looking so gloomy, he was just being curious. The house elves took his curiosity for real concern however and told him the whole sad story.
Draco Malfoy was a Slytherin, not a Gryffindor, like Harry Potter. But, on the other hand, nobody has ever liked Umbridge, so he thought of a plan and told the house elves that he will put Umbridge out of commission for a while and they’ll be able to have their evening off in peace. The elves were duly grateful and promised not to tell anyone about his promise.
And on the next day, one of Dolores’ Inquisitors (a Slytherin, of course) brought her an intercepted message that implied that Harry Potter (who else, of course?) has helped the house elves set up a party place to celebrate the retirement of the Venerable Hornet (or someone like that) in an old, abandoned, hollow tree.
Dolores Umbridge, of course, saw red, gathered everybody (starting with the first years and ending with Dumbledore, even though his twinkling eyes just bothered her for some reason) and led everyone to the tree in question, which she proceeded to break open with Alohomora. Big mistake, for that tree contained no house elves, throwing a party for one of their elders, but an entire nest of quite young, and powerful, hornets that proceeded to launch a counterattack on the Inquisitor in question, and were so successful, that Dolores Umbridge had to go to St. Mungo and recuperate there for about two weeks and a bit more. During that time Hogwarts had no DADA teacher (well, Snape had to fill in, but he managed to do so well enough), and the elves were able to have their time off in peace (headmaster Dumbledore certainly had no objections to that). They were, of course, very grateful to Draco Malfoy, who had started the whole thing, starting with the incriminating letter (signed, of course, with Harry Potter’s signature, for that was a Slytherin thing to do) and had enjoyed immensely the sight of Dolores Umbridge taken down for a while.
But Umbridge got back, just in time for Hermione Grainger (who took her inspiration from the whole hornet incident) to take her down using centaurs, for they were even bigger that hornets. That was the end for the High Inquisitor, and, incidentally, if anyone cares, never again did Dolores Umbridge dare to mess with the house elves of Hogwarts.