There was a war where Abram settled, because of a rebellion of a people against King Kedorlaomer. King Kedorlaomer ganged up with other kings: Amraphel, Arioch and Tidal, and warred against King Bera (of Sodom), King Birsha (of Gomorrah), and King Shinab, Shemeber and Zoar. Okay:
Side A: Kedorlaomer, Amraphel, Arioch, Tidal
Side B: Bera, Birsha, Shinab, Shemeber, Zoar.
Side B all joined up in the Valley of Siddim (where the Dead Sea is) and rebelled against the rule of King Kedorlaomer. Maybe the economy sucked, who knows.
Not only did Side A squish the rebellion, they then got on a tear and defeated the Rephaites, the Zuzites, the Emites, and the Horites, and conquered the whole land of the Amelekites and the Amorites.
So when the stand off happened in the Valley of Siddim between the kings of Sodom, Gomorrah, and other places (Side B) and King Kedorlaomer and his posse (Side A), Side B had to retreat after getting their asses kicked, and some of the men fell into the tar pits that were thereabouts.
Side A ransacked everything they could carry from the cities Sodom and Gomorrah (which, I believe, overlooked the battlefield) including Lot and his household. Silly Lot. You picked the wrong place to live, buddy!
Someone who escaped told Abram and his allies (when did Abram aquire allies? I don't know) that his nephew was now a POW.
Abram gathered up his "318" men in his household and, one assumes, his allies, and they all followed the pillagers. During the night, Abram divided the forces up to attack and got the jump on Side A. He got back Lot and everyone with him, and all the goods they had with them, and futhermore routed Side A and sent them packing.
When Abram got back, the king of Sodom came back, and some other king blessed and anointed him, and recieved a tenth of everything Abram had for his trouble.
The king of Sodom asked Abram to keep all the goods he had recovered and just return him his people, but Abram refused, saying that he would accept nothing from the king of Sodom, because he didn't want to be beholden to anybody. (Just the Phoaroh, I imagine). But he did ask that his allies get a share for fighting with him.
Does this story perhaps have something to do with why the author feels the men of Sodom sinned greatly against god? Is it that they were thought cowardly or weak because they didn't win the rebellion? That because of that weakness Abram had to get off his fat ass and go rescue his nephew? I think it does. But I'm not a biblical scholar by any means.