After the Sack of King's Landing, Eddard Stark led the forces of the alliance that brought Robert to power to Storm's End to lift the siege that was being maintained by the Tyrell forces. When Ned's host arrived, Mace Tyrell dipped his banners immediately. Shortly afterward, Ned led a group of six of his trusted northern bannermen (Howland Reed, Willam Dustin, Ethan Glover, Martin Cassel, Theo Wull, and Mark Ryswell) to an obscure tower nestled in the red mountains of Dorne -- the Tower of Joy.
The war began when Ned's brother Brandon heard that his sister Lyanna had been kidnapped by Rhaegar Targaryen. Riding immediateloy to King's Landing, when Brandon and his companions entered the Red Keep and shouted to Rhaegar to come out and die, King Aerys II arrested him for plotting to murder the crown prince. Rickard Stark and the other fathers of those arrested were called to King's Landing to answer for their sons. When there, Brandon, Lord Rickard, and most of the other Northmen were executed and tortured. Next, Aerys demanded that Lord Jon Arryn send him the heads of Robert Baratheon, Lyanna's betrothed, and Eddard Stark, both of whom were now lords. Rather than kill his two wards, Jon Arryn raised his banners in revolt -- an act considered to be the true start of the war known as Robert's Rebellion.
A serious question remains -- if Ned and Robert knew early on that Lyanna was in the Tower of Joy, why didn't they try to rescue her? Clearly Brandon had believed that Rhaegar had taken Lyanna to King's Landing, a mistake that cost him his life. It could be that Lyanna wasn't at the tower at the start of the war, but only arrived there near the end of the war. If so, how did Ned learn that information?
I'm making a few assumptions here. First, if the Starks knew were Lyanna was near the start of the war, then why did he go north from the Eyrie via the Fingers, Sisterton, and White Harbor, rather than south, toward Dorne? Second, had Robert known her location at the start of the war, the pathway his army took doesn't make a lot of sense -- while tactical considerations could have forced him to march north to Stony Sept, when he fought his battles at Summerhall and Ashford early in the war, he was as close to the Tower of Joy as he ever would be during the war. Wouldn't it make sense to try to reach the Tower of Joy if the Starks and Baratheons knew Lyanna was there?
So we're forced to conclude that Ned didn't know where Lyanna was until later in the war.
At the Tower of Joy, the seven Northmen clashed with three Kingsguard and killed them. His memories of that battle are intermingled with cries of his sister Lyanna crying out his name: "As they came together in a rush of steel and shadow, he could hear Lyanna screaming. 'Eddard!" she called."
From these memories, it would seem that the band of Northmen that road into the red mountains of Dorne had known Lyanna's location when they rode south from Storm's End. But how did they learn?
One clue might come from another of Ned's memories. "Martyn Cassel had perished with the rest. Ned had pulled the tower down afterward, and used its bloody stones to build eight cairns upon the ridge. It was said that Rhaegar had names that place the tower of joy, but for Ned it was a bitter memory. They had been seven against three, yet only two had lived to ride away; Eddard Stark himself and the little crannogman, Howland Reed."
As to the number of cairns, the math makes sense. We know that Ned had returned Lyanna's body to Winterfell, as Robert and he visited it at the beginning of AGOT. Other than that:
(7 Northmen - 2 survivors) + (3 Kingsguard) + (1 Lyanna) = 8 bodies to bury + 1 Lyanna.
What doesn't make sense is that two people alone could pull down a tower in which Rhaegar had hidden Lyanna for safety, and which the Kingsguard were assigned to guard. How do two people with horses destroy a stone structure by themselves?
What was the Tower of Joy? We can get some insight by considering what its military and geopolitical function might have been. Examining the map of the South in GRRM's novels, the "Tower of Joy" stood near the north end of the Prince's Path, one of three "castles" along that road. The other two are Kingsgrave and Skyreach. The first of these is the house of House Manwoody. Skyreach the ancient home of House Fowler, called the Wardens of the Prince's Pass. It would appear that the Tower of Joy was built as a guard tower to defend the pass against military invaders from the north. Rhaegar may have named the tower, but it's unlikely that he built it. It probably dates to a time before Dorne submitted to Targaryen rule (~187 AC), or even to the time before the Rhoynar arrived in Dorne, when the Fowlers were kings in their own right.
If the tower had stood for at least a century, likely under the jurisdiction of the Fowlers, and was able to securely house a pregnant woman for several months, it is exceedingly unlikely that two rebel lords would be able to pull the tower down for both physical and military reasons.
So how had Ned "pulled the tower down?"
There's an often-overlooked memory of Eddard's that may hold a clue. Eddard's first chapter in A Game of Thrones, we read, "They had found him still holding her [Lyanna's] body, silent with grief. The little crannogman, Howland Reed, had taken her hand from his."
While Ned and Howland Reed were the only survivors of the battle, there was at least one more person present to find Ned holding his sister's body. Who could that person be? Well, the first thing to consider is what it would take to knock down a fortified tower. I propose that it would take at least a dozen men with horses and the right tools. It would take someone with access to manpower and money who could operate openly along the Prince's Pass and destroy a tower that may have stood there for centuries.
In that House Fowler is charged with guarding the Prince's Pass, a strong possibility is that the "third person" who came upon Ned holding Lyanna's body was a Martell, to whom the Fowlers were bannermen.
Why would a Martell help Ned Stark, after he had helped lead the army that opposed the Royalist forces in which Dorne had taken part? To answer that question, we need to look at the events that led up to the battle at the Tower of Joy.
Following his escape from the Vale of Arryn, Ned Stark went north and called his banners. He marched his armies down to the Riverlands over a period of about four or five months. In Riverrun, the Stark, Tully, and Arryn forces assembled following the agreement that Ned and Jon would marry Catelyn and Lysa. Ned's first battle came in the Battle of the Bells at Stony Sept, where he defeated Royalist forces under Jon Connington. After that, the Rebels marched back to Riverrun, where Ned remained for a fortnight following his marriage to Catelyn.
It was the next battle of the war, The Battle of the Trident, when Ned would first cross swords with the forces of Dorne, who had marched up the Kingsroad and joined Royalist forces at King's Landing. In that battle, we know that the leader of the Dornish forces, Prince Lewyn Martell of the Kingsguard died at the hands of Ser Lyn Corbray wielding the Valyrian Steel blade, Lady Forlorn. After killing Rhaegar, Robert was injured, leaving Ned to lead the vanguard of Robert's army to King's Landing, trying to reach it before the Lannister army arrived.
Knowing what we do of Ned Stark, doesn't it seem possible that he tried to learn from Rhaegar where Lyanna was? We know that Robert's final hammer blow "stove" in the chest of Rhaegar, but did Rhaegar die immediately? One possibility is that Rhaegar lived long enough to tell Ned where Lyanna was. If so, wouldn't Ned have made that priority number one? Wouldn't Robert demand his forces to make their way to Dorne to rescue her? Wouldn't someone have sent a raven to friendly families in the South.. such as the Daynes? But the odds are very low that Eddard would have heard it from Rhaegar.
Following the death of Rhaegar, the Royal forces broke and fled back to King's Landing. Who might have been there? While Lewyn Martell commanded the Dornish forces leaving King's Landing, he had not been at the head of the column that marched north from Dorne. Who might be able to command Dornish troops gathered from the variety of Dornish nobles? Not the ruler, Prince Doran... but his trusted brother, Oberyn.
Given the fate of Elia and her children, it seems unlikely that any of the Dornish forces were present in King's Landing and almost impossible that any Martells had entered the city, especially if Oberyn was among the survivors after the Trident. So, I conclude from that logic that Oberyn Martell led the Dornish forces south from the Ruby Ford, and were not able to enter King's Landing.
We don't know a great deal about the fate of the retreating Dornish army, but we can conclude that the few of them reentered King's Landing. Had the Dornish forces reached King's Landing before the Lannisters, Dornish leaders would likely have been present for the eventual sack of the city. Any such leader, particularly Oberyn, would have sooner died than allowed harm to come to Elia and her children. So it seems impossible for the Dornish army to have re-entered King's Landing. So they likely moved south, back toward Dorne.
There are two points at which Ned Stark and Oberyn Martell might have met during the war. First: on the battlefield during or after the Battle of the Trident, it's possible that Oberyn saw Ned as a noble man who deserved to know where his sister was and got him a message -- maybe they even crossed swords (just to speculate).
Another time when Oberyn could have met with Ned was after the Sack of King's Landing, when Ned's force moving south (i.e., to lift the siege of Storm's End) would possibly run into the remainder of the Dornish troops heading back south. Given the possibility of conflict between the troops, it would be smart of Ned to offer the Dornish army a guarantee of safe conduct, and offer a meeting. From the House Martell motto, there is no way that Dornish forces would ever have surrendered. It could also have been a gesture of respect to Ned Stark for Oberyn to personally meet with him and tell him where his sister really was.
One likely scenario for this happening would be that in which Dornish forces joined the remaining Royalist forces besieging Storm's End. Mace Tyrell apparently already knew of the fall of King's Landing. It's possible Oberyn was there to tell him, and then had the opportunity to talk with Ned.
Oberyn meeting with Ned would also clear up a remaining question: how did the Martells learn the truth of how Elia and her children died? The odds that King Robert told the Martells about the Lannister forces killing Elia and her children are extremely low, while the general practice of politicians in King's Landing is to provide a pretextual story to hide the truth of what happens. However, Ned having left King's Landing immediately after his conflict with Robert over the murders meant that it was likely he would share the fate of Elia and her children with her family.
Assuming that Oberyn told Ned about the Tower of Joy and both being aware of how Robert treats Targaryen children, Oberyn and Ned would have joint motivation to destroy the tower and hide evidence of Lyanna's relationship with Rhaegar. As Oberyn cared deeply for his own children at a later date and Ned was a man of deep honor, it is totally within the character of both to work together to protect baby Jon. Oberyn's Martell family connections and their influence over their bannermen would provide the resources needed to make a structure hundreds of years old disappear.