Assassinations at the Twins

"My name is Arya Stark. I want you to know that... the last thing you're ever going to see is a Stark smiling down at you as you die."

- Arya Stark to Walder Frey just before cutting his throat.

The Assassinations at the Twins is an event late in the War of the Five Kings where Lord Walder Frey, the Lord of the Crossing, Lord of Riverrun, and Lord Paramount of the Trident, as well as his sons "Lame Lothar" Frey and "Black Walder" Rivers, are murdered by Arya Stark, who was previously believed to be dead. The death of these three individuals avenges the Red Wedding for the Stark family. Although the assassinations of Black Walder and Lothar are not shown onscreen, the death of Lord Walder is depicted in the episode "The Winds of Winter".

Prelude
"For 300 years, we kissed Tully boots, swore oaths to them and their stinking fish banners. Not again! Riverrun is ours. Take it back!"

- Walder Frey to his sons Lothar Frey and Walder Rivers.

Since the War of Conquest, House Frey of the Twins has been a vassal of House Tully of Riverrun, the Lords Paramount of the Trident. However, for their loyalty towards the Iron Throne - in reality, House Lannister - and for their actions during the Red Wedding in which Lord Walder Frey oversaw the massacre of King Robb Stark, Queen Talisa Stark, and Lady Catelyn Stark, as well as the Northern armies, Walder Frey is rewarded with Riverrun and is elevated to Lord Paramount of the Trident. During the Northern campaign, House Tully had allied with House Stark in securing independence for both the North and the Riverlands.

Meanwhile, Arya Stark was widely believed across Westeros to be dead. In reality, however, she escaped across the Narrow Sea to the Free City of Braavos, where she trained to become an assassin of the Faceless Men. Though she was able to learn some of their techniques and magic, she ended up leaving the guild, refusing to give up her identity, which is a requirement of its members.

Events
"They weren't easy to carve. Especially Black Walder."

- Arya Stark to a shocked and disgusted Walder Frey.

After leaving the Faceless Men, Arya returns to Westeros where she intends to continue crossing names off her death list. Though Walder's role in the deaths of her family at the Red Wedding is known far and wide, it is not entirely clear if Arya knew the full extent that his sons Black Walder and Lothar played, specifically killing her mother Catelyn and pregnant sister-in-law Talisa respectively. She eventually finds her way into the Twins, disguised as a servant girl during a banquet being held by the Freys with the Lannisters for their victory at the Second Siege of Riverrun, where she presumably learns about the deaths of Catelyn and Talisa and adds their killers to her list. At some point after the feast, Arya murders Lothar and Black Walder, and has them cooked into pies, which she later serves to Walder Frey.

While Walder eats the served pies, he notes that the servant girl is not one of his progeny as she is "too pretty", and slaps her rear. He then asks aloud where his "moron sons" are, to which the servant girl replies that they are right there - indicating that they are in the pies. When Walder realizes the horrible truth by lifting the crust and finding a human finger inside the pie, Arya reveals herself. She taunts him, saying the last thing he will ever see is a Stark smiling down at him as he dies. Walder attempts to flee, but Arya grabs him and slits his throat, watching with satisfaction as Walder bleeds out and chokes to death on his own blood.

Aftermath
With the orchestrators - Tywin Lannister, Roose Bolton, Walder Frey, Lothar Frey, and Walder Rivers - all dead, and House Bolton now extinct, the Red Wedding has been virtually avenged.

It is not entirely clear who the new head of House Frey will be, as it is currently unknown if Walder's eldest son, Ser Stevron Frey, is still alive. It is possible that due to Walder's many children, the line of succession will not be clear, potentially throwing the house - and the Riverlands - into even more chaos as the Freys were already facing repercussions for Walder's treachery before Arya killed him.

If there is a succession crisis, resolving it will most likely take precedence over any loyalties that the surviving Freys have to House Lannister. Even if this crisis is brief, there is no guarantee that the new Lord or Lady Frey would share his or her father's loyalty to the Lannisters; assuming there is a Lord or Lady Frey in the event that the Freys are overwhelmed (if not wiped out) by their enemies. This would be disastrous for Queen Cersei Lannister, especially after her recent actions, as House Frey is, for now, the only extant Great House that has not sworn allegiance to either Daenerys Targaryen or the Kingdom of the North.

In the books
In "A Song of Ice and Fire" novels, at least seven Freys have been killed so far in revenge for the Red Wedding: Unlike in the show, Arya had nothing to do with the above killings - she is still in Braavos at that point; none was committed at the Twins; Lord Walder Frey is not one of those who ate from the Frey pies; he, Black Walder and Lothar are still alive by the point the books reached. It is not mentioned in the books how Lord Frey reacted to these deaths.
 * Petyr Pimple, Merrett and Ryman have been hanged by the Brotherhood without Banners.
 * Of those, Ryman is the only who actually took part in the massacre (he killed Dacey Mormont), while Petyr and Merrett's part was limited to getting Greatjon Umber too drunk to fight - but such minorities wouldn't bother the Brotherhood.
 * Ryman's death made his son Edwyn the heir of the Twins.
 * Jared, Rhaegar and Symond mysteriously disappear on their way from the White Harbor to Winterfell, to participate in Ramsay's wedding, and are never found.
 * Hosteen and Aenys Frey grow worried about the absence of their kin, and ask the Boltons to look for them. Ramsay and his men ride back to where Lord Manderly claims they parted ways, but in vain. Roose speculates that since Lord Manderly’s litter moves very slowly, and his health does not permit him to travel more than a few hours a day, with frequent stops for meals - the missing Freys were anxious to reach Barrowton and be reunited with their kin, so they rode on ahead. Ramsay is not overly concerned with his failure to find them, dismissing the whole matter with "The world won’t miss a few Freys. There’s plenty more down at the Twins should we ever have need of one".
 * It is speculated (and supported by Arya's deed in "The Winds of Winter") that Lord Wyman Manderly had them killed and baked them into the three pies he brings to Ramsay's wedding, to avenge his son's death. He made sure that Roose and the two attending Frey officers - Hosteen and Aenys - would eat from the pies, then, for good measure, asked Abel the bard (actually Mance Rayder) to play the song about the Rat Cook.
 * Lord Manderly has not violated the guest right by killing those Freys, although they were his guests for a while: when asked by Ser Hosteen where they are, he answers innocently (or feigns innocence) "The road has many dangers, ser. I gave your brothers guest gifts when we took our leave of White Harbor. We swore we would meet again at the wedding" - thus, by giving the three Freys "guest gifts", they were no longer protected by the guest right, and technically he was free to kill them.
 * "Little Walder", Merrett's nine-year-old son, is murdered at Winterfell.
 * Hosteen Frey immediately confronts Lord Manderly, who denies the accusation but baits Hosteen into attacking him by remarking that Walder's death may be a blessing as "he would have grown up to be a Frey."