بسم الله الرحمن الرحيم
We would like to clarify that the letter باء doesn't necessarily cause the letter before it to change to a ميم sound nor does the ba' change to any other letter. There needs to be special circumstances.
There are two different but simlar rules involved in this and we aren’t sure whether you mean the إخفاء شفوي, in which is a ساكنة ميم rule or الإقلاب, which is a نون ساكنة and تنوين rule. So we will cover each of the two rules in our answer to give a complete understanding in sha’ Allah.
If a ساكنة ميم is followed by a باء, we then hide the ميم with an accompanying غنة. This is called إخفاء شفوي (ikhfa’ shafawee) and can be found in the following example.
The إخفاء شفوي must not be confused with الإقلاب rule of نون ساكنة and تنوين. If the letter باء occurs immediately after a نون ساكنة or تنوين, it is then required to change the نون ساكنة or تنوين to a hidden ميم. This rule is calledالإقلاب (iqlaab) or القلب (qalb) and exemplified in the following:
Please see the following lessons to learn more about the above mentioned rules.
The ikhfa’ shafawee and the iqlaab have the same mechanism after the نون ساكنة changes into a ميم in the iqlaab. Please see the following link for a complete explanation.
The reason of changing the نون to a ميم in the iqlaab rule is the difficulty one finds in pronouncing the letter باء immediately after a نون. The نون is articulated from the tip of the tongue while the letter باء articulates from the two lips and it is difficult for a reader to pronounce a باء right after the نون.
In order to make it easy and fluent, the نون changes to a ميم that is articulated from the same articulation point as the باء. It is easier to pronounce two letters from the same articulation point. Moreover, ميم is similar to the نون as well in terms of their characteristics as they both have the characteristic of غنة. ميم is like a “middle letter” between نون and باء as it has the characteristic of غنة which is similar to the نون and articulates from the two lips like the letter باء. Therefore, the نون changes to a ميم if it is followed by a باء.
Please note this change is not only applied while reading the Qur’an. For example, a common Arabic speaker who doesn’t know anything about tajweed, would still read the Arabic words أنباء and عنبر as ambaa’ and 3ambar.
Allah knows best.