The Nephites recognized the importance of having the authority from God in order to baptize and to act as an agent of God in creating a binding covenant relationship (Mosiah 18:10; 21:35). Mosiah 18:13 says, "And when [Alma the Elder] had said these words, the Spirit of the Lord was upon him, and he said: “Helam, I baptize thee, having authority from the Almighty God."
Conversely, in Mosiah 21:33–34, the people of Limhi, who had been taught by Ammon, desired to be baptized, but "Ammon declined doing this thing, considering himself an unworthy servant. Therefore, they did not at that time form themselves into a church, waiting upon the Spirit of the Lord." They were baptized later by Alma, who had received permission from King Mosiah to set up churches and ordain priests.
It was important then, as it is now, that baptism and other ordinances be performed by one having authority from God through a person holding the appropriate keys. Jesus would specifically give this power to his twelve disciples as his first organizational step in 3 Nephi 11:21–28.
In early Christianity, one finds similar expressions. Ephesians 4:5 says, "One [eternal] Lord, one [true] faith, one [authorized] baptism," and Hebrews 5:4 says, "No man taketh this honor [of being able to administer in priesthood ordinances] on himself, but he that is called of God, as was Aaron." All this makes it clear that it is important to receive the ordinance of baptism in the correct way and as administered by one holding divine authority.
Book of Mormon Central, "What Does the Book of Mormon Teach about the Priesthood? (Mosiah 23:17)," KnoWhy 289 (March 20, 2017).
Daniel C. Peterson, "Authority in the Book of Mosiah," The FARMS Review 18, no. 1 (2006), 149–185.