In the case of a borrowing, languages often end up producing a foreign word with native phonology which can lead to all sorts of changes in how a word is pronounced. For example, take the English word 'baseball' , this word has been borrowed into Japanese but owing to the constraints on Japanese sound structure (the language does not like consonant clusters or for syllables to end on anything but a vowel or a nasal sound like n, m, etc) the actual word ends up being pronounced something like baseboru or "bahsayboru". So, this sort of thing might well account for what happened in your example.

For internal change in languages, there are all sorts of possibilities for what might happen. Taking the Germanic languages as a whole there's the whole concept of Grimm's Law which accounts for, among other things, for why the English word for 'paternal parent' is 'father' while the in many of the related Indo-European languages the word is something like 'pater'.

In a more generic example, let us say I had an invented proto-language with a word *hanta meaning "house" and I wanted to derive some possible forms for daughter languages. One common kind of sound change is for voiceless sounds like [t] to become voiced when they appear between voiced sounds. So, our original *hanta might have a descendant word in pronounced something like "handa". In this case the voiceless [t] became a voiced sound,[d], when it appeared between the voiced sounds [n] and [a].

Now, taking that same original word *hanta we can imagine a number of other possible changes that might occur.

The consonant cluster 'nt' might become disallowed in a daughter language and the cluster reduced to just a [t] sound, giving us "hata". However, the loss of that original [n] might also trigger something called compensatory lengthening in which some lost sound is compensated for by the lengthening of one of the preserved sounds. So, *hanta loses its [n] but let us imagine that the the [t] becomes lengthened to compensate giving us the daughter word "hatta". The [t] is not the only sound that could have lengthened in this case. It might well have been become "haata" instead.

Another thing that might well happen with the loss of the [n] sound is that some nasalization might yet remain even though the [n] is gone. French is famous for its lost of final n-like sounds but the preservation of the nasalization on the remaining vowels. Hence the French word "bon" is pronouced as something like [bõ]. The same sort of thing might have happened to the example word I invented. Original *hanta might lose that n but the preceding vowel still carry some nasalization, thus giving us the possible daughter word that might even be spelled the same but pronounced [hãta].

Sound changes like these tend to affect the whole lexicon and can bring about fairly radical changes in a fairly short span of time. That said, changes like these aren't in effect for ever. Once the change is complete the langauge might well preserve the new forms for a long time and, moreover, if that change alters words enough to put new sounds in environments that triggered changes before, it does not mean the change will happen again.