Things aren't looking great in Kings Landing. On Sunday night's episode of Game of Thrones, "No One," King Tommen decided to outlaw trials by combat, leading his mother, Cersei, to start looking into other ways to get out of her upcoming trial date. Her first option? Exploring "old rumors" about the capital — which, many fans believe, means the hidden caches of wildfire left under the capital by the Mad King. Is Cersei going to make the city go boom? If so, that could be bad news for Tommen, who's been marked for death by a prophecy given to Cersei as a child. But if Tommen does kick the bucket, who becomes king next? The answer ... well, the answer is complicated.
First, let's recap how we got here. Three-hundred years before Thrones is set, Aegon I Targaryen invaded Westeros with his dragons, uniting most of the continent's fractious kingdoms into one single polity. (Dorne came later, through a marriage pact.) Aegon's descendants ruled for hundreds of years, until Aerys II, the Mad King, was deposed in Robert's Rebellion, with House Baratheon earning the Iron Throne by right of conquest. Robert Baratheon passed the crown to his ostensible son Joffrey, who died without children and so passed the crown in turn to his little brother, Tommen.
Now, if Tommen were to die without children as well, a succession crisis might emerge between Tommen's sister Myrcella and his uncle Stannis. That's a bit of a moot point for us, since both of them are dead, as is Robert's other brother, Renly. In the eyes of the ruling regime, Stannis and Renly were both traitors who rose in rebellion against their nephews, so even if they were alive they would not inherit the throne. Stannis's entire line has been attainted, too, which would rule out Shireen if she, too, were not already dead.
From there, things get even more mixed up. Robert Baratheon was chosen as the new king in no small part because of his own tiny drop of Targaryen blood. His grandmother was a Targaryen, and it turns out, because his father was an only child, his closest remaining relative on that side of the family is actually Daenerys. But, in deposing the Mad King, did Robert's Rebellion also eliminate the succession rights of his descendants? The Lannisters would probably say yes; Dany's dragons would probably say no.
If Targaryens can't inherit, then we have to go all the way back into the Baratheon family tree to see if we can find a branch that still survives to the present day. Fortunately, we don't have to do that to ourselves, because this Redditor already did, and guess what they found? Robert's great-great-great-great-(repeat as many times as necessary)-grandfather Corwen does have living descendants wandering around Westeros, and they're actually ... the Lannisters. And, since Jaime has been removed from the Kingsguard, he's allowed to inherit lands and titles again, which means that he is technically next in line for the Iron Throne. Yes, Jamie is his own son's heir — Lonzo and Oscar got nothing on him.
But instead of resorting to claims that pass through long-dead Baratheons, Tommen's successor would probably be decided by a Great Council, where all of the lords in Westeros gather together to vote for the claimant they want to be the next king. After that, it's all a matter of who makes the most compelling case. Jamie and Cersei don't have much in the way of allies at the moment, so they'd probably be the Martin O'Malley of this particular race. The Tyrells could press for Margaery to rule on her own, but the Westerosi patriarchy might be wary about the precedent that would set. Other ambitious lords might try to gain control of Gendry, or any other of Robert's bastards, and put them forth as a potential king. Hell, if Jon Snow has already learned the truth of his parentage by then, even he could make an argument for the throne, though after his terrible experience leading the Night's Watch, it's unclear if he would want to.
But so far in Westerosi history, Great Councils have only been called during times of peace, and right now the continent's been wracked by violent sectarian warfare for years. As England saw during the Wars of the Roses, at a certain point it doesn't really matter who has the best claim; it only matters who can take the throne, and who can hold it. (In real life, Henry Tudor's claim was pretty dang tenuous, but he won the battle of Bosworth Field, so he got to be the king.) There's no one house in Westeros strong enough to hold all of the squabbling lords together if Tommen dies, but it's possible that Daenerys and her dragons could unite the realm, just as her ancestor Aegon did. Or maybe the Iron Throne won't exist at all. Some fans predict the series will end with the Seven Kingdoms returning to the way they were before the Targaryens came: a loose collective of kingdoms led perhaps by Sansa in the North, a Tyrell in the Reach, a Sand Snake in Dorne? If that happens, all hail King Tommen, the first and last of his name.