Let’s start from the very beginning. One of the first sounds a child can pronounce, most likely through imitating sucking at the breast, is the syllable ‘ma’, and it is from this syllable that, perhaps in all languages of the world, the word for ‘mother’ is derived. In Proto-Slavic, the word ‘mama’ arose from the reduplication of this first infantile sound. Reduplication, or the repetition of morphemes, is a derivational device characteristic for the formation of words denoting familial kinship as well as for children’s speech, hence: mama, tata, baba (‘mom’, ‘dad’, ‘granny’) (as well as other words from child speech, such as siusiu or lala [‘pee pee’, ‘dolly’]).
Mama is an affectionate (but not diminutive) term for ‘mother’ (matka), ‘a woman who gave birth to a child and also usually raises it – in relation to that child’ (source: WSJP). If we want to trace how the word matka came to be, we should first go back to the Proto-Indo-European era (about five thousand years ago), when the name for ‘mother’ was formed from the base ma- by adding the suffix -ter, characteristic of the formation of kinship-related words, examples of which are the Latin pater (‘father’) or frater (‘brother’). The Proto-Indo-European mater was found its continuation in the Proto-Slavic form *mati, which in Polish took the form mać – the same form found today in vulgar insults, e.g., psia mać [literally ‘dog’s mother’, equivalent in meaning to ‘God damn’, trans.], but also in sayings: jaka mać, taka nać [an equivalent of ‘like mother, like daughter, trans.]. Other Old Polish words derived from the Proto-Slavic form *mati, meaning macierz (‘mother’ or ‘matrix’) and maciora (‘mother’, contemporary equivalent: ‘sow’), found in ancient literary texts. Over time, mać, macierz and maciora began to differentiate semantically and stylistically. Today, macierz (outside its use inspecialized fields such as biology or mathematics) primarily means ‘homeland’, while maciora means ‘female pig or boar’ (source: WSJP). In the 15th century, a diminutive version of the form mać appeared – matka, created using the form *-ъka. According to Krystyna Długosz-Kurczabowa, ‘the vocabulary for degrees of kinship is characterized, among other things, by the fact that diminutives and pet names often undergo expressive neutralization and require constant refreshing and renewal’. Therefore, from the word matka, which lost its diminutive nature, further hypocoristic (endearing) forms began to be created: matula, matuleńka, matusia.
A different person is mamka (‘wet nurse’), meaning ‘a woman who breastfeeds another woman’s child for a fee’ (source: WSJP). It’s worth noting that in this case, the form -ka does not create a diminutive, but rather indicates mamka’s similarity to mama – the fact of the former fulfilling the function of the latter.
From the Proto-Slavic *mati, the form *matjecha was also created, and then, around the 14th century, transformed into macocha (‘stepmother’), meaning ‘father’s wife in relation to his children from a previous marriage’ (source: WSJP).