To summarize 9 or 10 hours of Rabbi Daniel Raccah's shiurim on the subject in a single paragraph:
Malki-Tzedek is identified with Shem, Avraham's great (x7) grandfather. Noach originally aspired for his sons to be the Torah teachers in the world (like Avraham, Yitzhak and Yaakov eventually would be), but only Shem adopted the calling. That's why Shem/Malki-Tzedek is a kohen to God. Shem watched the 4 kings fight the 5 kings (all of whom were Shem's descendants) with the intention of snaring Avraham in the crossfire, and killing him. But Avraham stood up and risked his life to save Lot, and succeeded. From this, Malki-Tzedek understood that Avraham had the character traits necessary to be the primary Torah teacher in the world, and that Makli-Tzedek did not. So Malki-Tzedek went out to greet Avraham and pass the torch to him as the Torah leader of the world.