The answer lies with babies and how they start to talk. The pioneering linguist Roman Jakobson figured it out. If you’re a baby making a random sound, the easiest vowel is ah because you can make it without doing anything with your tongue or lips. Then, if you are going to vary things at all, the first impulse is to break up the stream of ahhh by closing your lips for a spell, especially since you’ve been doing that to nurse. Hence, mmmm, such that you get a string of mahs as you keep the sound going while breaking it up at intervals.
Babies “speaking” in this way are just playing. But adults don’t hear them that way. A baby says “mama” and it sounds as if he’s addressing someone—and the person he’s most likely addressing so early on is his mother. The mother takes “mama” as meaning her, and in speaking to her child refers to herself as “mama.” Voilà: a word mama that “means” mother. That would have happened with the first humans—but more to the point, it has happened with baby humans worldwide, whatever language they are speaking. That means that even as the first language was becoming countless others, this “mama mistake” was recreating “mama” as the word for “Mom,” whatever was going on with words like mregh.
Papa and dada happened for a similar pan-human reason. After babies begin making m with their lips, they pick up making a sound that involves a little more than just putting their lips together—namely, putting them together, holding them that way for a second, and then blowing out a puff of air. That’s p—or, depending on your mood, b. Alternatively, babies also start playing with their mouths a little further back from the lips—on that ridge behind the upper teeth that we burn inconveniently by sipping soup when it’s too hot. That’s where we make a t or a d. The order in which babies learn to make sounds explains why the next closest usual caretaker to mom is so often called papa or baba (or tata or dada).