Rhaegar Targaryen is arguably the most important Game of Thrones character, and until the season seven finale, we had never even seen him. His death marked the end of a long and complicated rebellion full of forbidden love and a plethora of fighting and murder. If you're wondering how or why he died, or perhaps you've forgotten, we are here to help, because he's definitely an important piece of the Westeros puzzle.
Rhaegar is the eldest son of "Mad" King Aerys II, making him heir to the Iron Throne and Daenerys's oldest brother. The Targaryens are allies with the Lannisters way back when at this time, and Cersei always thought she might marry Rhaegar, but the two families' peace falls apart when the Mad King instead marries Rhaegar to Elia Martell of Dorne, with whom he has two children. But everything really falls apart in the Seven Kingdoms when Rhaegar sees Lyanna Stark at the Tourney of Harrenhal.
Rhaegar is so taken with Ned Stark's sister (who was also Robert Baratheon's betrothed) that when he wins the tournament, he gives the victor's wreath to Lyanna instead of his wife. Several months later, Rhaegar allegedly abducts Lyanna, but we've known from season six and beyond that she actually goes with him of her own free will — and they secretly get married, as we found out back in Game of Thrones' season seven episode "Eastwatch" (though at the time the Game of Thrones characters still all think Lyanna was the victim of kidnap and assault).
This controversy is what spurs Robert Baratheon's rebellion, backed by the great Houses Arryn, Greyjoy, Stark, and Tully. The Lannisters even eventually join the rebellion after the Battle of the Trident, which is where Robert kills Rhaegar with his war hammer.
This defeat is the beginning of the end of the Targaryens, which is why the Lannisters finally join Robert's side — like true Lannisters, they wait to see which side emerges victorious before they make a choice.
After Rhaegar's death, the Lannisters sack King's Landing. Jaime kills the Mad King (thus his nickname, Kingslayer), bannerman Ser Gregor Clegane (aka The Mountain) kills Elia Martell and Rhaegar's two children, and the rebellion is complete. Tywin Lannister marries his daughter Cersei to Robert, and King Robert takes the throne.
However, Rhaegar's line lives on. While all of this is happening during the rebellion, Rhaegar sends his pregnant new wife, Lyanna, to the Tower of Joy under the watch of Kingsguard members Ser Arthur Dayne and Ser Gerold Hightower. Eddard tracks his sister there and is present when she gives birth to Rhaegar's son and heir, Aegon Targaryen. Ned passes the baby boy off as his own bastard because Lyanna asks him to protect the baby from King Robert (who would surely kill Rhaegar's heir if he knew the truth), and that's how Jon Snow comes to be part of the Stark family.
Now, in season eight, there are a select few people privy to this information: Bran, who initially sees the vision of Rhaegar and Lyanna marrying, and then later Lyanna giving birth; Samwell Tarly, who reads about the union in the journals at the Citadel; Jon himself, because Sam tells him in the season eight premiere; and finally Rhaegar's little sister, Daenerys Targaryen.
Naturally Dany's none too pleased to discover that Jon is the rightful heir to the Iron Throne when he divulges this shocking information in the Winterfell crypts in season eight's second episode, "A Knight of the Seven Kingdoms." (Even if it does exonerate her brother from all those accusations of rape and kidnapping.) Will she attempt to kill him in next week's episode, when the Battle of Winterfell finally begins? Only time will tell, but hopefully she's learned from her family's history of violence.