Why did the Lannisters take Riverrun

Why was Robb attacking Tywin Lannister's army at the same time as his surprise attack on Jaime?

System Down has adequately answered this question.

This is just to add a graphical representation to make the situation clearer.


Situation before the crossing

Before Robb crossed the trident, the situation followed.

  1. Jaime's host had besieged Riverrun from different directions. (Shown as three hosts as Riverrun had to be besieged from three different sides.)
  2. Robb Stark was trapped north of the Trident with The Twins, trying to figure out a way to break the siege of Riverrun.
  3. Tywin Lannister had occupied the Ruby Ford and made the Inn at Crossroads his headquarters.

At this point, Walder Frey was neutral and was related to Casterly Rock due to the marriage between Lord Tywin's sister Genna and Lord Walder's son Emmon. Tywin seized the initiative, seized the Ruby Ford, and sat firmly on the Kingsroad to fend off a strong attempt to cross the river from there and outflank Jaime's host. By occupying this point, he also ensured that they had to fight the Arryns before they ever got to Riverlands.

Tyrion joined his father at the Crossroads Inn when he was freed by Eyrie.

The following map shows you the exact locations of all hosts:

As you can see, if Robb had acted directly on Jaime, Robb would have marched quickly south across the ford and then cut west until they crossed the red fork and then Jaime and Tywin could finish Robb together. So Robb had to secure his flank and stern in front of Tywin and also relieve Riverrun. Rather than putting everything in one battle, Robb chose to split his men and tie Tywin in Ruby Ford while freely smashing Jaime's host with the mobility of his cavalry.


Situation after the crossing

As it turned out, Freys joined Robb. Robb took most of his cavalry and crossed the Southern Bank of the Twins. He would go fast and hard to Riverrun and unsuspectingly take Jaime with him. He put his foot in command of Roose Bolton, who swung southeast along the Kingsroad to engage Tywin Lannister with Ruby Ford and deny him the chance to help Jaime.

Tywin knew nothing of the split and Ser Addam Marbrand, commander of the Lannister Outriders, could only report on the movement of Bolton's forces, which Tywin incorrectly referred to as the main body of Stark under the command of Robb Stark. The location of the armies after the crossing followed:


Battles at Greenfork and Whispering Wood

Robb's plan worked. Bolton distracted Tywin long enough to allow Robb to defeat Jaime in the Battle of Whispering Wood. Starks suffered heavy losses at Green Fork, but they managed to delay Tywin's aid to Jaime. Tywin failed to hunt down survivors of Bolton's army because he wanted to help Jaime with his siege.

The battles map follows:

As you can see, Tywin was stuck a long way off thinking he was fighting Robb Stark. He didn't know Robb had captured Jaime. Robb's simultaneous attacks in the east and west had managed to achieve their ultimate goals.


aftermath

Now unhindered in the west, Robb quickly resumes his victory and launches a surprise attack on armies besieging Riverrun. In the Battle of the Camps, Lannister suffered a crushing defeat when captive Jaime Lannister's leaderless armies were destroyed in their camps amid great confusion and disorder.

Tywin Lannister soon learns of these developments and retreats to Harrenhal to avoid encirclement by possible allied Baratheon Stark forces and to be in a defensible position from which he can attack Starks or defend KL from a Baratheon attack could. Roose Bolton moves to occupy Ruby Fork, which was an extremely valuable position from a strategic point of view as any allied Arryn forces would have needed to follow Riverlands and any Lannister adventure (though unlikely given Tywin and Kevan's experience) Entering north to threaten Vale or north would have to pass from there ..

Obviously, due to his simultaneous attack on Tywin Lannister and Jaime Lannister, Robb got the following results:

  1. He tied Tywin where he couldn't save Jaime.
  2. He broke the siege of Riverrun and destroyed a substantial part of Lannister's power.
  3. He had Tywin retire to Harrenhal.
  4. He won Riverlords over by defending their land and freeing Edmure Tully.
  5. He blocked Lannister's path to threaten North & Vale by securing the Ruby Ford & Twins.
  6. He was now ready to attack the Lannisters in their own lands to the west, with the only Lannister army trapped in Harrenhal with enemies on all compass points. Robb in the west, Bolton in the north, Renly and his Baratheon Tyrell Forces in the south, and Stannis Baratheon in the east.

Calissar

Enough with the necromancer badge! That answer is not even a good one! Just kidding, nice;)

Aegon

@ Kalissar Haha. Again, not a new activity so I need to add what I can to the existing answers