The Greyjoy family, which rules the Iron Islands, rebelled against Robert Baratheon, but the rebellion failed. As punishment, Theon, the only surviving son, was sent to live with the Starks as a prisoner. However, the family treated him well and he was brought up as almost another son.
At Theon's suggestion, Robb Stark sends him to Theon's family in the Iron Islands to ask his father to become an ally to Robb Stark. His father, Balon, refuses and tells him that he's planning to attack the North while the Starks are busy with their own war. Theon wants to impress his family above all else and agrees to fight with them against the Starks, but is insulted when he is given only a single ship to command. He tries to think of something to do to impress his family and decides to attack and take over Winterfell, the Starks' home. He does so and takes the two remaining Stark children, Bran and Rickon, captive, but the two manage to escape. Forces from Robb Stark come and surround Winterfell and Theon is sure to be defeated, so his men betray him, knock him unconscious and are last seen preparing to bring him as a captive to the Northern forces.