Nephite baptism is to me quite mysterious. We know they do it but the practice seems to evolve over time a fair bit. It’s worth noting the differences between baptism in Palestine and among the Nephites. First, the baptism of John the Baptist is quite mysterious. While the common assumption is that it arises out of the form of Judaism the Essenes practiced, the details are controversial. Ritual immersions were actually quite common in Judaism but, unlike in Christianity, were not just for conversion. Indeed baptism for conversion seems a rather late development. As late as the Maccabee era circumcision was the the token of the covenant and required for conversion. Many scholars argue that before period of the exile there wasn’t any real conversion at all within Judaism. Later during the rabbinical period a type of mikveh (ritual washing by immersion in special fonts) became part of the conversion process. While there really is a paucity of data for pre-exilic Jewish conversion, Nephite baptism does appear out of character.
It’s worth noting that while baptism seems unusual before John, the idea of immersion for ritual washings was part of the law of Moses. Exactly how much of that Leviticus code developed during and after the exile isn’t clear. The more traditional Jewish mikvahs are done for numerous reasons and aren’t quite so limited the way we think of baptism. The high priest would ritually immerse himself at least three times a year for the Day of Atonement (doing it five times during the day), Day of Pentecost and Feast of the Tabernacles. It’s also done for other reasons such as ritually cleansing for women after menstruation or men for seminal fluids. In the Torah it marks a move from unclean to purity although we have to keep in mind that uncleanliness wasn’t always tied to sin but often was simply tied to bodily fluids (male or female) or illness. In modern Judaism one does a mikvah prior to marriage for instance. Also unlike baptism, typically one did the mikveh oneself, rather than having it administered to oneself.
This notion of ritual cleaning by water might explains one of the oddities of Alma’s baptism. In Mosiah 18 he baptizes himself at the same time he baptizes someone else. That seems alien to us but is closer to the traditional notion of a mikveh. While mikveh are typically tied to purification they don’t usually get associated with a covenant. The key symbol of the covenant, at least in post-exilic times, was circumcision. However early on Book of Mormon baptism is tied to a covenant. (See for example Alma 7:15 which significantly inspires the Mormon view of baptism) An other big difference in the Book of Mormon is the notion of authority for baptism whereas under the law, outside of certain priestly duties, one did the cleansing oneself. This is a key Mormon concept somewhat alien even to much of Christianity.
My guess is that the covenant language of baptism comes out of King Benjamin’s famous last address. There he doesn’t associate mikveh with the covenant but blood. (See for instance Mosiah 3:11, 15, 18) Some have speculated that Benjamin’s address was done on the Feast of the Tabernacles. If so, then the priest (presumably Benjamin) would have engaged in multiple mikvehs as part of the process. Yet Benjamin doesn’t talk about that and instead talks about calling on God’s name for a remission of sins. The climax of his speech is a covenant (Mosiah 5:5) tied with taking Christ’s name that the people take up. This covenant language repeats through the Book of Mormon forming the basis of Alma’s baptism in Mosiah 18 and the sacrament prayer. It’s crucial to note though that for Benjamin that the covenant simply isn’t tied to baptism nor any water imagery.
This is not to deny that baptism is important before Benjamin. However the context is quite different. First Lehi learns that Christ will be baptized (1 Ne 10:9) then Nephi in his vision sees the baptism of Jesus by John. While we can’t assume Lehi’s understanding of the Law is the same that we find in the second temple period in Jerusalem, it’s fair to guess that he recognizes this as a mikveh. When Nephi then talks about baptism it isn’t quite the same way we think of it as a covenant, but is purely an emulation of what Jesus does. We witness we’re willing to take the name of Christ by “following [our] Lord and [our] Savior down into the water” (2 Ne 31:13) Now this taking the name is the one place where Benjamin and Nephi have overlap. Nephi does explicitly see the purification aspect of baptism that was common to the mikveh in the Law of Moses. (2 Ne 31:4-8) However the emphasis every time he speaks of it isn’t as an ordinance on its own but as a sign that we are following him and humbling ourselves.
The two threads come together with Abinadi. Abinadi is quite the mystery in that we have no idea where he comes from. It’s probably safe to assume that he was present for Benjamin’s address since Abinadi quotes or paraphrases it regularly. It’s Abinadi who converts Alma (although Alma was a priest – but to a corrupt and possibly syncretic form of the Law of Moses) and it’s Alma who gives us our conception of baptism in Mosiah 18. Alma seems to tie baptism to Abinadi’s Christology. The opening of Mosiah 15 takes up Nephi’s conception of Christ suffering the will of the Father, albeit in an even stronger sense. Abinadi’s focus is on who Christ’s seed is, using extensive reference to Isaiah. His idea appears that to take Christ’s name is akin to how Christ takes the Father’s name.
After Abinadi’s death, Alma takes up Abinadi’s words, mixing extensive aspects of King Benjamin’s speech with the idea of baptism in Mosiah 18. Following Nephi’s use, the baptism is a witness of what we are to do. But Alma intertwines the idea of imitating Christ in baptism with the covenant Benjamin’s people make.
…what have you against being baptized in the name of the Lord, as a witness before him that ye have entered into a covenant with him…
It’s worth noting here that while later rabbinical Judaism uses a mikveh as the final step of conversion, there is no sense of covenant making. In post-exilic Judaism prior to the rise of rabbinical Judaism it appears that circumcision is the sign of the covenant. There are even indications that circumcision was required of converts. The origins of John’s baptism are more mysterious. The typical view is that it was an extension of the form of Judaism practiced by the Essenes and tied to a mikveh for ritual cleansing. But again, it’s not clear it’s for entering a covenant. We think of baptism as entering into a covenant, but this comes out of Alma and not the Palestinian church.
Going back to Benjamin, there is an interesting way in which Benjamin’s speech as a Sukkot or feast of the tabernacles might be related to baptism. The feast of the tabernacles is in memory of the wandering in the wilderness as Moses led them from Egypt to the promised land. While a later change to the Book of Mormon, Joseph modified Nephi’s quotation of Isaiah 48 to the following:
Hearken and hear this, O house of Jacob, who are called by the name of Israel, and are come forth out of the waters of Judah, or out of the waters of baptism, who swear by the name of the Lord and make mention of the God of Israel, yet they swear not in truth nor in righteousness.
This change makes the crossing of the river Jordan symbolically into a type of baptism. Note that in the Sukkot there are nightly water drawing ceremonies. While we can’t be sure that matches the form among the middle Nephites, it is possible. No strong water imagery is found in Benjamin’s address though. Yet it’s hard not to read Nephi seeing the crossing of the Jordan as a type of baptism as entering into the promised land after being purified. The culmination of Sukkot is the Great Salvation or Hoshaana Rabbah. This is the day when the judgment issued on Rosh Hashanah and Yom Kippur is finalized. It is the end of judgment. It’s quite possible that when Benjamin brings people to the covenant that it is ritually tied to entering into the land of promise in the Exodus pattern. Except that for Benjamin this is taking Christ’s name. Symbolically it is the entering into heaven by becoming like Christ.
 See for instance Shaye Cohen argues in From the Maccabees to the Mishnah “The central ritual of conversion was circumcision. This practice, quite common in the ancient Orient (Jer 9:24-25), figures prominently in only a few sections of the Bible . . . All these passages assign some unusual importance to circumcision, but the Bible as a whole generally ignores it and nowhere regards it as the essential mark of Jewish identity or as the sine qua non for membership in the Jewish polity. It attained this status only in Maccabean times . . . For the Maccabees, circumcision was such an essential component of Jewish identity that upon conquering various sections of the holy land they incorporated the inhabitants into the Jewish polity, a step that meant first and foremost circumcision . . . By the end of the first century BCE, circumcision was widely known to the Greeks and Romans as a typically (though not exclusively) Jewish practice.” (43-44)
 See John A. Tvedtnes, “King Benjamin and the Feast of Tabernacles,” in By Study and Also By Faith and Terrence L. Szink and John W. Welch, “King Benjamin’s Speech in the Context of Ancient Israelite Festivals,” in King Benjamin’s Speech: “That Ye May Learn Wisdom,”
 I should add that Nephi does see it as commanded, as he says in 2 Ne 31:11-12 but he seems to see this as something new and the emphasis is to “follow me, and do the things which ye have seen me do.”
 See Gordon C. Thomasson, “Mosiah: The Complex Symbolism and Symbolic Complex of Kingship in the Book of Mormon” and Adam Anderson “Exploring and Explaining the Intertextual Relationship between King Benjamin and Abinadi.”
 The Sukkot is mandated in Deuteronomy 31:10-13. It’s worth noting that some see the Book of Deuteronomy as developing around the time of Josiah and thus close in time to Lehi.