system
Given the following post, respond as if you're commenting on Reddit:
human
[Song of Ice and Fire] As smart as Rhaegar was said to be, and given that he'd previously been sowing dissent against his father, why didn't he switch sides with some of his loyalists when Robert's Rebellion started gaining steam?
gpt
I don't think Robert would have accepted it. First due to not trusting a Targ turncoat, but *moreso* that Robert started the war for Lyanna's sake. The only acceptable outcome for Robert would be that Rhaegar hands Lyanna over, she says Rhaegar never touched her, also says that he protected her from someone trying to rape her, before Rhaegar swears fealty to Robert. So basically an impossible path to victory here.

What you have instead is that Rhaegar tries to switch sides. Robert is metaphorically drenched in hatred for Rhaegar, but holds his tongue under the advice of all his allies (especially Ned). After all, a charismatic and skillful Targ prince behind him will surely sway the war considerably in his favour. He demands Rhaegar bend the knee and relinquish Lyanna if he wants to join Robert's cause. Rhaegar states he cannot give up Lyanna. He loves her. And, he states, she loves him. Robert is losing his cool, and suggests Rhaegar is another mad Targaryen who mistakes raping a woman for mutual love. Rhaegar admits he divorced his last wife and married Lyanna in a consensual ceremony.

Robert is enraged, orders his guards to attack Rhaegar and his men. The skirmish ends with Arthur Dayne and Rhaegar slaying many of Robert's men before escaping to regroup. Robert issues a command to the Lords who swore him fealty, stating that regardless of where their supposed loyalties lie, all Targaryens are to be put to the sword. Especially Rhaegar. Lyanna is to be captured, and the truth will be forced from her own mouth.

Various houses split off, concerned that Rhaegar seems like a good leader and or that Robert is motivated by irrational jealousy. House Stark even waivers, Ned fearful for his sister's safety if jealous Robert takes his anger out on her. The Rebellion is extended as the now-three factions (Aerys Loyalists, Rhaegar Revolutionaries, Robert Rebels) trade lives and land frequently. "Aegon Targaryen VI" (aka Jon Snow) is born. Rhaegar being publicly committed to Lyanna makes no small secret of their son's existence. This confirms to Robert that Rhaegar was speaking true, and as such their family will be put to the sword. He tells Ned that Lyanna will have a chance to survive if she denounces Rhaegar and their mistake of a son, but Ned realises it won't play out that way.

House Stark joins Rhaegar's faction, acknowledging that Rhaegar is more honorable, Robert is clearly losing the plot, and Ned has to protect his sister and nephew. Robert is defeated at the Trident, and the Revolutionaries march on King's Landing. Jaime Lannister slays Aerys as he's screaming "Burn them All". Rhaegar takes the throne with Lyanna as his queen, and Prince Aegon VI as their heir. Ned is Warden of the North. Eventually political alliances between the Starks and Targaryens are strengthened as Danaerys is wed to Robb Stark. Viserys is wed to Margaery Tyrell (to secure the Tyrell funding). Aegon (Jon) is married to Myrcella "Bolton", Cersei and Jaime's secret bastard daughter, believed to be the daughter of Cersei and her arranged husband Roose Bolton, in order to secure the loyalties of House Lannister and House Bolton.

Sansa Stark is promised to Theon Greyjoy to repair the relationship between the Starks and the Greyjoys. Arya Stark refuses to be matchmade, and strikes off on her own for a while. Bran is engaged to Ned's best friend Howland Reed's daughter, Meera. Rickon is still too young to consider betrothal, but is considered a match for Lord Jorah of House Mormont's cousin, Lyanna Mormont. 

The realm prospers until the Night's Watch inform House Stark about the White Walkers. The Realm is quickly convinced of the threat due to Ned's honour, and Rhaegar/Lyanna's willingness to believe him. The Maesters in The Citadel quickly research The Night King and discover a bunch of tales regarding his faction from over thousands of years. Dragonglass is mined and forged into weaponry as is prudent to do so, given its supposed strength against the Dead. Valyrian Steel smiths are brought in by the Crown to outfit the best warriors in the land with Valyrian Steel weapons. Barristan Selmy, Jaime Lannister, Aegon Targaryen VI, Oberyn Martell, Sandor Clegane, Gregor Clegane and Loras Tyrell are some of those outfitted with the Realm's best equipment.

The Wildlings are all but wiped out. With no Jon Snow gaining mutual trust with the Freefolk, they're hard pressed to pass the Wall. Mance Rayder's army does pose a threat, but is repelled at Castle Black by a joint team of Stark/Stannis Baratheon soldiers bolstering the Night's Watch garrison. Mance Rayder's army is picked off and encorporated into the Night King's army. Multiple Wight Giants help bust through the tunnel through The Wall, overrunning Castle Black. The Dead begin funnelling through, marching on the Realm. However with such a united Army of the Living prepared for such an invasion, the Dead are met at Winterfell and pushed back. Wildfire trebuchets clear out swathes of Wights, clearing the way for heroes like Ser Barristan and Beric Dondarrion to take out the Wight Walkers, and Jaime Lannister to gain honour to his Kingslayer title by slaying the Night King.