I am watching Game of Thrones, and I am confused that Robb Stark needs to ask for ships from the Greyjoys. Isn't it all land between the North and King's Landing? It isn't like Stannis' position where there is a large bay separating him from the capital.
He doesn't need to get to King's Landing. He needs to capture King's Landing.
King's Landing has very strong walls, and the most vulnerable point is the harbor. However, Joffrey commands a fairly strong fleet.
Robb needs a fleet to take advantage of the best angle of approach. The Iron Islanders have a very strong naval force.
The plan is for Robb to lead his armies by land to King's Landing, and then coordinate their attack with the Iron Islanders' fleet attacking the harbor.
After re-reading A Clash of Kings, the correct answer is more that Robb hopes to have the Ironborn fleet attack the Lannisters directly, striking at their home in Lannisport.
Robb and his armies would march across the land to King's Landing. However, in the meantime the Ironborn would sail towards Lannisport, the seat of Lannister power, and attack it from sea.
If the attack succeeds, it would be a crippling blow to the Lannisters. Even if it failed, it would prevent Lord Tywin from committing more Lannister forces to King's Landing, making it much easier for Robb's armies to storm the town.
"By now Robb is at the Golden Tooth," Theon said. "Once it falls, he'll be through the hills in a day. Lord Tywin's host is at Harrenhal, cut off from the west. The Kingslayer is a captive at Riverrun. Only Ser Stafford Lannister and the raw green levies he's been gathering remain to oppose Robb in the west. Ser Stafford will put himself between Robb's army and Lannisport, which means the city will be undefended when we descend on it by sea. If the gods are with us, even Casterly Rock itself may fall before the Lannisters so much as realize that we are upon them."
This is explained more thoroughly in the Clash of Kings book.
Theon was sent by Robb Stark to Pyke (the Iron Islands) to have Balon Greyjoy (Theon's father) attack Casterly Rock (the Lannisters' City), on the west side of Westeros, from the sea, while Robb's forces attack them from Land. In return, Robb would have given Balon back his Crown as King of the Iron Islands. Balon was made to bend the knee (by Ned Stark) and give up his crown some years before, after the Iron Islands rebelled against King Robert. The idea was to hit the Lannisters at their home, and weaken them, and then with Renly, close in on Tywin's forces from north and south.
So it has nothing to do directly with King's Landing (which is on the east of Westeros)
I've not seen season 2 yet, it will not air here until May. I think you should fill out your question with more detail, as it is not easy to understand the context here, seeing as the books and the TV-show differ somewhat.
Here's my reasoning that comes from knowing only the books:
Robb has White Harbour, which from what I understand is a great sea power on the east coast. If Robb wanted to get to King's Landing, I doubt very much he would send to Balon Greyjoy, as he would need to sail halfway across the world just to get there. Especially when White Harbour is much closer, and the allegiance of White Harbour is much less questionable.
However, the Lannisters have the Redwyne fleet, which reputedly is the strongest in Westeros. I believe Stannis also controls a major part of the crown's fleet, which sits off Dragonstone. Robb has White Harbour, which probably is the least of those fleets.
However, he holds the trump card: Theon Greyjoy. With Theon, he can secure a fleet that is among the strongest in Westeros. With such a fleet, he can keep the Redwyne fleet occupied in the west, taking pressure off White Harbour's fleet. Controlling the seas is of crucial importance in the war.
And besides that, securing the alliance of the Iron Islands is nothing to sneeze at. They are a martial and hardy people who make for bad enemies. What's more, Robb considers Theon his friend and ally, and by extension probably considers the Ironborn his allies (we don't know exactly what Robb thinks, since he has no POVs).
Re-reading AGOT recently, I read an exchange in a very early Ned chapter, where he tells Catelyn to tell Robb to strengthen Moat Cailin and keep a closer watch on Theon Greyjoy (for this very reason).
Robb wants the Iron Fleet so he can directly attack Lannisport, (just like Victarion did during the Greyjoy Rebellion.) Raiding the port just a day or two's march from Casterly Rock would force Tywin's hand, especially with Robb's continuing march west. He does not wish to attack King's Landing.
King's Landing is on the east of the continent whereas the Greyjoy ships are on the north-west. The only help they could provide is by attacking Casterly Rock in the far west (the Lannisters' home).
It makes sense that Robb would turn west against the Lannisters if he is able to take out Tywin's current forces in the Riverlands, leaving Renly to go east and take King's Landing and having to deal with Stannis who is even further east.