Abram, after departing Egypt, goes back to where the altar had been set up. At this point, he is very wealthy. As is his nephew Lot... Therefore, they weren't able to peacefully co-exist in the same land because there weren't enough resources for them and their people to sustain themselves. A feud occurs between the herdsmen of the two men and then Abram says, "We can't both stay here. You go your way, I'll go the other way." So Lot decides that the land by the river Jordan was pretty fertile looking and moves that way...which happens to be in Sodom (a place of exceedingly sinful men). It is now that God tells Abram to look around and see all that surrounds him, for it shall all be his. Then Abram builds another altar in Hebron.
Now, while this is happening a war is breaking out between an alliance of 4 area kings and an alliance of 5 area kings (the king of Sodom was among these). Why does this matter? because Lot is in Sodom and Sodom is overrun...therefore Lot is taken. Abram is notably upset by this and gathers his men to go and save Lot. They run down Lot's captors and smite them by nightfall, getting back Lot and all of his goods (and his women, by the way). Upon returning Lot, the king of Sodom rushes out to meet Abram, thanking him for helping his kingdom. He offers to give Abram all of the goods he has gotten back for the kingdom of Sodom, but Abram will have none of it. Clearly, Abram does not want to be considered a champion of Sodom's cause. Helping Sodom was only a by-product of helping Lot.
More to come....the destruction of Sodom was foreshadowed in chapter 13 10: "...the plain of Jordan, that it was well watered, before the Lord destroyed Sodom and Gomorrah..." Sodom and Gomorrah hasn't been smitten yet, but we are told about it so I'm guessing it will be happening pretty soon.