Daenerys eventually built up enough of a presence to start attracting attention from the great houses of Westeros, even as their own civil war rages after the death of Robert Baratheon. Most notably, she gained the support of Tyrion Lannister, on the run from Westeros and ready to make a break from his own house. She also allied with House Greyjoy of the Iron Islands, House Martell of Dorne, and House Tyrell of the Reach, and finally arrived in Westeros.
While at Dragonstone, she met Jon Snow, Ned Stark's illegitimate son and the King in the North. Jon refused to bend the knee to Daenerys, instead seeking an alliance against the Night King's army. She was also surprised when one of her dragons, Drogon, allowed Jon to touch him.
During a rescue mission, one of Daenerys's dragons, Viserion, was killed by the Night King, and Jon was seriously injured. In the aftermath, Jon and Daenerys came to an understanding and eventually began a romance.
During this time, back in the archives of Winterfell, Samwell Tarly and Bran Stark uncovered a secret. Rhaegar Targaryen didn't kidnap Lyanna Stark — they were in love, and they ran away together. Bran uses his Greensight to "see" the truth: Rhaegar had his first marriage annulled and married Lyanna, who became pregnant.
Lyanna wasn't murdered during the war, but died giving birth to a son named Aegon. With her dying words, she begged her brother Ned to keep him safe, which he did by claiming her son as his own illegitimate son, Jon.
Still unaware of his real lineage, Jon journeyed to Winterfell with Daenerys and their army. There, Sam finally told Jon that he was a Targaryen by birth and the true heir to the Iron Throne.