Abraham met Melchizedek king of Salem (Jerusalem) after he slew Elamite king Chedorlaomer, (Kindattu) the very Elamite king who had destroyed his birth place city of Ur.
The Elamite king had collected tribute from the Canaanites for twelve years while Pepi II was still alive. Chaos struck Egypt when Pepi II died and the Amorite/Canaanites then rebelled for two years against Kindattu.
Chedorlaomer (Kindattu)then invaded Canaan in full force, and Abraham won victory praising God for Lot's safe return.
Melchizedek worshiped the God of the Most High for he was a holy priest/king, whereas when Abraham had visited Pepi II in Egypt, where the pharaoh was worshiped as a living god, and the Memphis dynasty ended a few years before, Abraham won victory over the Elamites.
It seems like Abraham was cleansed by his meeting with Melchizedek after having dealt with the pagans Pepi II and Kindattu.
Jerusalem (Salem) was God's Holy City, unlike Ur and the Memphis dynasty which went down in flames. Sodom citizens did not appreciate Abraham saving their lives for some 20 years after Pepi II died, Sodom was destroyed by God for its citizens wickedness.