And now it came to pass that as Alma was journeying from the land of Gideon southward, away to the land of Manti, behold, to his astonishment, he met with the sons of Mosiah journeying towards the land of Zarahemla.
Who’s that again? Well, do you remember Mosiah 28?
Now it came to pass that after the sons of Mosiah had done all these things, they took a small number with them and returned to their father, the king, and desired of him that he would grant unto them that they might, with these whom they had selected, go up to the land of Nephi that they might preach the things which they had heard, and that they might impart the word of God to their brethren, the Lamanites
So, they went and had some adventures for 14 years, then, on their way back, ran into Alma, and told him about what they were doing for all that time. Verses 1-4 of Alma 17 are them greeting each other, 17:5-20:28 is Ammon’s journey, then he met up with his brethren and stayed with them for 7 chapters when they met Alma in 27:18.