The story begins with Pandion, the King of Athens. You see, he married his maternal aunt, Zeuxippe. Now, Apollodorous doesn't SAY anything about the Gods punishing him for this kind of marriage (the only such marriage in Greek legend, according to the Perseus Project), but I think that is a possibility considering what happened to his family. Pandion and Zeuxippe had two daughters, Procne and Philomela, and twin sons, Erechtheus and Butes1. But Pandion wasn't much of a father, he was much more interested in his kingdom, and when Athens went to war with Abdacus, Pandion called on Tereus, his neighbor in Thrace, and asked for help.
Now, Tereus was not only the ruler of Daulis (unimportant and relatively obscure nation), he was also the son of Ares, and because of his big connections in Thrace, he won the war for Pandion. Pandion, being the good diplomat and smart businessman that he was, decided that he should reward Tereus as well as consolidate a relationship with him, and since he was a horrible father who saw his daughters primarily as bargaining tools, he gave his daughter Procne to Tereus in marriage.
Tereus had his kicks with Procne, leaving her to bear their son, Itys, but after the fun was done (for him) he abandoned Procne in his house in the country, where no one would no she was there. Then he went back to the house of Pandion, and decided he had a thing for Philomela. He told Philomela that her sister had died. He completely seduced Philomela, and soon had married her as well.
Upon marrying her, he did the most romantic thing possible, he cut her tongue out. This dude was seriously sick. But Philomela was an accomplished weaver (like most upper class Greek women) and she wove characters into a robe, thereby letting her sister Procne know what was going on. Procne, who really had no idea what was going on until that point, immediately set out, bringing her son, Itys, with her. At last Procne found her sister, but because of her own abuse and because of what she saw done to her sister, Procne went nuts.
Pretending to go along with Tereus' evilness, she told him she would make him a wonderful dinner. Then she went into the back room, killed her son, boiled him up, and served him to Tereus. While Tereus feasted on his son, Procne grabbed Philomela and ran.
Once Tereus realized he'd been tricked, he took an axe and went after them. The women ran, but they were unused to flight, and were soon overtaken in Daulia. They prayed to the Gods to be turned into birds, and the Gods took pity. Procne was changed into the nightingale, constantly crying her sorrow in the sounds, "Itu, Itu" (the name of her son). Philomela became the voiceless swallow. And Tereus, also changed into a bird, became the hoopoe, which calls out, "pou, pou" which means "where, where" in Greek.
NOTES: This story is a true tragedy. Sophocles wrote Tereus to tell the story, but that play is mostly lost. The only other place you can find these stories told today (other than the ancient historians and poets) is in Aeschlyus's The Birds. 1. Apollodorous quotes these two as Pandion's sons, but Pausanias laments how Pandion bore no sons to revenge his daughters.