In Roberts Rebellion, Elia Martell of Dorne and her children Aegon and Rhaeneys were murdered by The Mountain, under Tywin Lannisters order. But he ordered the Mountain to spare the twin of Aegon, a girl named Alysandra. He wanted to be able to hold Dorne at something, so they wouldn't revolt over the murder of their beloved princess and her children. He believed her claim, being the youngest child and a girl was not strong enough for her to claim the crown. So she grew up in Kings Landing, under the watchful eye of the Lannisters. She learnt how to play the game of thrones. And when she played...she won.
** IMPORTANT** I have made up the character of Alysandra. She is not a character in the books or television show.