The king of Sodom went out to meet Abram after his return from the slaughter. Why did he not go with Abram? Probably because of fear, and he evidently recognised the courage of Abram in doing what he had not been willing to do.
Perhaps there were others under him or similar to him at the time, but there was a priesthood even in the early patriarchal times. We also learn from this that there are always more believers than we realize. Just when you think Abraham and Lot are alone as believers in the ancient world at this time, suddenly you get not just another person of faith, but a king of righteousness and a priest functioning. No doubt there were people here and there and in all sorts of places, for there to need to be an officiating priest. You discover that God is often at work in ways you can't see. People say nowadays, what about all the pagan nations where there's no testimony to speak of, or only a very small representation? You have no idea how many people of God there are around the world, and how they learned of Christ and how they were brought to salvation. This is just an insight into patriarchal times where the record does not tell us much about the people of faith living then. Here, a king of righteousness appears from nowhere.