Dany learned the same lesson as Stannis
"Lord Seaworth is a man of humble birth, but he reminded me of my duty, when all I could think of was my rights. I had the cart before the horse, Davos said. I was trying to win the throne to save the kingdom, when I should have been trying to save the kingdom to win the throne."
Dany effectively did the same thing when she promised to help Jon destroy the Night King even though he hadn't bent the knee.