A contrast is immediately seen at this point in the book of Mosiah between the improper uses of authority by King Noah and his priests, as opposed to the righteous use of priesthood authority by Alma.
Some have wondered exactly how Alma the Elder received his priesthood authority. We are not completely told. In one sense, he would have been ordained as a young man to be a priest of King Noah. Perhaps he was additionally given authority at some previous point by Abinadi; and, although completely speculative, that idea would explain why Alma was prepared and willing to defend Abinadi in court and to record and teach his words so precisely.
Alma plainly stated that he had "authority from the Almighty God" to baptize (Mosiah 18:13), so he may even have been ordained by an angel, as was Joseph Smith, or was visited by the angel of the Lord, as was King Benjamin. Whatever the case, Alma knew what needed to be done to organize a covenant community to help his people have "the Spirit of the Lord," that God might grant to them "eternal life, through the redemption of Christ, whom he has prepared from the foundation of the world” (18:13).
Did Alma hold the Melchizedek Priesthood or the Aaronic Priesthood? Alma was clearly not from the tribe of Levi, and so he did not officiate under the Levitical line of authority. Alma the Younger was clearly aware of the importance of the great high priest Melchizedek (see Alma 13:17) and of being ordained unto the high priesthood within the holy order of the Son, the Only Begotten of the Father (Alma 13:6–9). So, it would certainly appear that Alma had received the Melchizedek priesthood in some form, although that holy order of priests was organized at that time differently than it would be when Christ would come and would ordain priesthood holders to distinct offices, particularly as he did with his twelve apostles in the Old World or his twelve disciples in the New. Additionally, Alma worked closely with the king. He obtained permission from King Mosiah to "establish churches throughout all the land of Zarahemla," as well as "power to ordain priests and teachers over every church" (Mosiah 25:18–19), along with jurisdiction to judge cases of covenant breaking by church members (Mosiah 26:12).
Whatever the administrative details may have been, Alma knew what needed to be done to organize the Church. Appropriate leadership, proper authority, and correctly performed ordinances produce a trust that encourages participants to honor their covenants. Alma the Elder demonstrated these characteristics.
Book of Mormon Central, "Why Does the Book of Mosiah Talk So Much About Priesthood Authority? (Mosiah 23:17)," KnoWhy 101 (May 17, 2016).
Daniel C. Peterson, "Priesthood in Mosiah," in Mosiah, Salvation Only through Christ, Book of Mormon Symposium Series, Volume 5, ed. Monte S. Nyman and Charles D. Tate Jr. (Provo, UT: BYU Religious Studies Center, 1991), 187–210.